I am running Ubuntu Server 14.04.4 under VirtualBox on a Windows server. When I first set up the machine I opted to put /boot on its own 230 MB partition. This turns out not to have been necessary for my situation and now I’d like to roll /boot into the much larger partition I use for /. How can I safely make this change?
Asked
Active
Viewed 3,941 times
8
bdesham
- 343
2 Answers
8
Short answer: If it ain't broke, don't fix it.
Long answer: If you insist on fixing what ain't broke:
- Open a Terminal window.
- Type
sudo mkdir /boot2 - Type
sudo cp -a /boot/* /boot2/ - Type
sudo umount /boot - Type
sudo rmdir /boot - Type
sudo mv /boot2 /boot - Edit
/etc/fstaband comment out the line that defines the mount point for/boot. - Type
sudo grub-install - Type
sudo update-grub(if you're using a BIOS-based install, you'll also need to specify a device filename -- probably/dev/sda) - Optionally delete the
/bootpartition and resize the root (/) partition. See here for details on how to do this.
I have not tested this procedure! If I've forgotten something or if there's an unexpected error, your system will be rendered unbootable! Hence:
- Please reconsider my "short answer," above.
Rod Smith
- 45,120
- 7
- 66
- 108
2
Updating with new answer that supports EFI. (EFI requires a FAT32 partition mounted as /boot/efi).
sudo cp -a /boot /boot2sudo umount /boot/efi && sudo umount /boot || echo -e "\n\rNot EFI?? STOP!"sudo rmdir /bootsudo cp -a /boot2 /bootsudo rm -r /boot/efi/*sudo mount /boot/efisudo diff -r /boot /boot2 && sudo rm -r /boot2 || echo -e "\n\r\n\rSOMETHING'S WRONG, STOP!!"sudo nano /etc/fstab- Edit /etc/fstab and comment out the line that defines the mount point for /boot. Leave the /boot/efi entry unaltered!
sudo update-grub- Make sure entries are found in /boot/, e.g. "Found linux image: /boot/vmlinuz-*"
- Optionally, delete the /boot partition and resize the / partition.
NiJo
- 56