Formatting a Boot Partition on Ubuntu in Azure Without GPT
# mkfs.ext4 /dev/sda2
The files from the /boot
directory should be copied to the new boot partition:
# mkdir -p /tmp/sda2 # mount /dev/sda2 /tmp/sda2 # cp -a /boot/* /tmp/sda2
Find the UUID of the new boot partition:
# blkid -o list /dev/sda2 device fs_type label mount point UUID -------------------------------------------------------------- /dev/sda2 ext4 (not mounted) b425c93b-533d-4e73-\ 8c2b-dbca05b9a8f1 # umount /tmp/sda2
Add an entry to /etc/fstab
to mount the new boot partition, like this:
UUID=b425c93b-533d-4e73-8c2b-dbca05b9a8f1
/boot
ext4
defaults,discard
0 0
Important: Mount the /boot
partition. For example:
# mount /boot
Re-install grub on the current boot device. The following command copies the GRUB files to /boot
:
# grub-install /dev/sda
Linux has a new BootLoaderSpec system which prevents "grub2-mkconfig" from auto-generating the boot loader config file. To prevent this, disable the BLS config by changing the following line in /etc/default/grub, before running grub2-mkconfig:
GRUB_ENABLE_BLSCFG=true
to GRUB_ENABLE_BLSCFG=false
Note that GRUB is being installed on /dev/sda
but the boot directory comes from /dev/sda2
. Update your GRUB configuration to take this change into account:
# grub-mkconfig -o /boot/grub/grub.cfg
Reboot the system and make sure that it boots properly from the new boot partition.