Moving /boot partition without messing up the system

bootgrub2partition

Partition layout

I have deleted my old Linux Mint partition I had installed beside my new current Rafaela one.
Thus, I have free space I want to add to my home partition.
Above you can see the partition layout:
sda4 is the system partition with /boot
sda5 is the home partition

I want to extend home with the unallocated space, but unfortunately the system partition is inbetween and I would need to move it to the beginning of the unallocated space.
Since I got a warning message that the system might not boot anymore, if I move /boot, I would like to know how I can do it without breaking the system.
It makes sense that the system cannot boot, if the bootloader cannot find the kernel anymore, so I guess after changing the partition layout I need to chroot on / and regenerate grub.

Does anybody know how I can add the unallocated space to home safely?

Best Answer

The boot sector needs to find the boot partition, after that the boot loader goes off the partitions, it doesn't care were they're located at on the drive.
I'm assuming you're using gparted live by the screen shot. After resizing you'll need to from the shell:

  1. Mount your relocated root partition containing the boot directory
  2. if /boot is a separate partition mount it in the root partition mount
  3. Mount the /dev to the dev directory in your root mount using the --bind option
  4. Chroot into the root mount
  5. Run grub-install or liloconfig to reinstall the boot sector
Related Question