I am in the midst of moving these two partitions from sda5 and sda6 to sda1 and sda2 respectively. This is to allow me to have a contiguous space for the root file system to grow. The following is what I have done so far:
- Create partition sda1 for EFI System with
gdisk
- Create partition sda2 for boot with
gdisk
- Copy content on sda5 to sda1 with
dd
- Copy content on sda6 to sda2 with
dd
- Remove boot flag on the old EFI System sda5 with
parted
The following is what I have now (# parted -l
):
Number Start End Size File system Name Flags
1 1049kB 211MB 210MB fat16 EFI System boot
2 211MB 735MB 524MB ext4 Microsoft basic data
4 200GB 250GB 50GB
5 250GB 250GB 210MB fat16 EFI System Partition
6 250GB 251GB 524MB ext4
7 251GB 481GB 230GB lvm
Upon reboot, the boot menu that I was presented with is still tied to what is inside the old EFI System partition in sda5, despite turning off its boot flag. How to proceed further from here?
Best Answer
Just to share, this is what I have done:
There is no need to perform
grub-install
since all the files are already there. What needs to be done subsequently is to create a new boot option at the partition sda1 using the EFI boot manager and pointing to theshim.efi
bootloader:Then check its boot position (refer to PARTUUID using
blkid
if not sure):and make sure that it is the first boot loader in the sequence:
For grub, what needs to be done is to change all instances of
/boot
location to point to the new partition:Search and replace "gpt6" with "gpt2" (if /boot is moved from sda6 to sda2)
To prevent the OS from mounting the old
/boot
and/boot/efi
partitions due to duplicate UUIDs, edit fstab:Replace the duplicate references of UUIDs with PARTUUID (if you are using GPT) or device node (e.g. /dev/sda1).
Reboot and you are done.