Moving /boot partition without messing up the system

6,361

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
Share:
6,361

Related videos on Youtube

Thorben
Author by

Thorben

Updated on September 18, 2022

Comments

  • Thorben
    Thorben over 1 year

    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?

  • Thorben
    Thorben over 8 years
    Today I moved and resized the partitions and everything worked without problems. I even didn't need to chroot onto the root partition. I guess it's because /boot/efi is a separate partition. However, I mark this as solution, because I think that this might be the answer, if you get problems. By the way, remember to use a 64bit live medium for 64bit. Otherwise you cannot chroot on the disk.
  • MVanOrder
    MVanOrder over 8 years
    I didn't think of 64/32 bit difference, but that's correct. in order to run 64 bit binaries on the OS you're chrooting into you need to be running a 64 bit OS.