Moving /boot on Ubuntu 14.04
This guide will assume you already have a Ubuntu 14.04 machine running on VMware. I had an issue in my Home Lab with my Ubuntu machines, they had reached 100% on the /boot partition due to bad maintenance! I had to find a solution to move the /boot to another partition. These are the steps to migrate the /boot to another partition.
You will need to initially download the latest Ubuntu Desktop ISO that can be found here
When the ISO has completed you will need to power off your Ubuntu machine so that you can boot from the Ubuntu CD. The easiest way to do this (If you do not have an ISOs Datastore) is to navigate to Edit Settings on the VM and select Force BIOS Setup in the Options Menu.
At this point you should also extend the disk by the amount you want to add to the /boot partition. For example I have extended my existing disk by 1GB that I will be using as the /boot partition as this should be sufficient.
You may have to change the boot order on the VM to make sure that it boots from the CD instead of the Hard Disk. You can do this by navigating to the Boot section in the VM and using the minus (-) key to lower the options above the CD-ROM Drive.
You will now need to connect the ISO to the VM. You can do this by clicking the CD sign and selecting the relevant option for your ISO.
When you have connected the ISO it will start the Ubuntu Setup.
You will need to select the ‘Try Ubuntu’ option to run Ubuntu in Live mode.
You’ll need to install Boot Repair on to the Ubuntu machine. You can do this by running the following commands on the Live CD.
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair
When you have installed Boot Repair, you should navigate to GPARTED to view the current partitions on the system. You should note down the Mount Point name at this point as we will need it later when running the commands for GRUB.
As above you can see the 1GB Unallocated partition that I have added on the VM.
You will need to select the New Partition Icon in the top left of the screenshot. This will bring up the following box to confirm your partition size –
You then need to select the Green Tick Icon to confirm the required changes.
If this is successful you will see the below –
You will now need to open Boot Repair so we can move the GRUB partition on the machine to the new partition that we created. In this example this is called /sda3
When opening the program it will ask you if you are using RAID on the machine –
You will need to navigate to the Advanced Options section and you will be presented with the following, you will need to change the ‘Seperate/Boot Partition’ to the new partition we created. In this case it was /sda3.
sudo chroot “/mnt/boot-sav/mapper/MOUNT-POINT-NAME” apt-get -f install
sudo chroot “/mnt/boot-sav/mapper/MOUNT-POINT-NAME” dpkg -configure -a
sudo chroot “/mnt/boot-sav/mapper/MOUNT-POINT-NAME” apt-get install -fy
sudo chroot “/mnt/boot-sav/mapper/MOUNT-POINT-NAME” apt-get install -y -force-yes dmraid
sudo chroot “/mnt/boot-sav/mapper/MOUNT-POINT-NAME” dmraid -ay
sudo chroot “/mnt/boot-sav/mapper/MOUNT-POINT-NAME” apt-get install -y -force-yes lvm2
sudo chroot “/mnt/boot-sav/mapper/MOUNT-POINT-NAME” apt-get purge -y -force-yes grub*-common grub-common:i386 shim-signed linux-signed*
sudo chroot “/mnt/boot-sav/mapper/MOUNT-POINT-NAME” apt-get install -y -force-yes grub-pc linux-generic
You will now need to select the partition you will be installing GRUB on. In this example it is /sda3.
When this is completed it confirm you can now restart your VM. Don’t forget to unmount the CD so it boots in to the Ubuntu partition!
When Ubuntu has finished booting you can login and verify the /boot partition has now been relocated by running the following command –
As you can see the boot partition has migrated successfully and is now running on the /dev/sda3 partition!
Thanks for reading!