After resizing the last partition to maximum, /boot is not mounted after booting

I'm using the efi squashfs version of the x86-64 image version 21.02.1. After following the doc to resize the partition and filesystem to maximum, upon rebooting, my /boot is empty, and /etc/mstab contains no /dev/sda1 entry, but everything else seems to fine, I can connect to the internet without any issues.

What might cause /boot to not be auto-mounted after booting?

lsblk -o +FSTYPE,UUID; uci show fstab

Thanks for the quick reply.

After some endeavor, I managed to locate the code that mounts /boot:

It seems /boot will only be mounted, at lease in my case, if the partition (the one containing the root filesystem) ID is ended with 02, and I can confirm it works by changing the partition ID manually.

I wonder what's the significance of 02?

When one follows the doc, the partition ID is bound to change. Whether it ends with 02 is totally by chance IMO.

2 Likes

I know this is abit old, but I did figure out the significance.

root@OpenWrt:~# lsblk -o PATH,SIZE,PARTUUID
PATH SIZE PARTUUID
/dev/sda 447.1G
/dev/sda1 16M e17df3c5-34ef-dc5b-56cb-adb6fe092901
/dev/sda2 447.1G e17df3c5-34ef-dc5b-56cb-adb6fe092902
/dev/sda128 239K e17df3c5-34ef-dc5b-56cb-adb6fe092980

notice how the root partition has an 02 because it follows subsequent order of the boot partition.

If you follow the partition resize guide here

you will get a new PARTUUID for the root.

which you will have to change in /boot/grub/grub.cfg.

Here is where it gets a bit tricky, the source code you listed above expects that root PARTUUID will never change by ankering in the 02 at the end. This can be completely fixed by using tools like gdisk.

I followed this gdisk guide for changing the PARTUUID back to its original value.

or you could just change root= to root=/dev/sda2 and be done with it.

1 Like

so root=/dev/sda2 can be read by grub.cfg?

don't know, but it can be interpreted by the linux kernel, which is probably more important.

I just came here to tell you that the /boot won't be mounted if the kmod-fs-vfat isn't installed. Works with root PARTUUID ending in 02 and /dev/sdx2 in GRUB config.