Upshot: Grub v2.06 generates a grub.cfg that boots the wrong partition

Cause: different bootable partitions were assigned the same root=UUID in grub.cfg in the "linux" boot specification. They all have different UUID in reality.

The longer story: I have 3 versions of Ubuntu (20,21,22) installed on my machine, but when I select to boot 20 or 21 it still boots 22! The reason turns out to be that ALL the entries in grub.cfg have the same UUID specified:

linux .... root=UUID=....ddde

But the ....ddde partition is the one that contains Ubuntu 22.04. The grub menu shows an entry as Ubuntu 21.04 (or 20.04.3), but grub still boots Ubuntu 22.04 from that entry because the wrong UUID is being used.

Running update-grub and/or grub-mkconfig is what produces the errant grub.cfg file. And I don't understand why this is happening.

grub-mkconfig is reporting sensible findings, such as

Found Ubuntu 20.04.3 LTS (20.04) on /dev/sda3
Found Ubuntu 21.04 (21.04) on /dev/sda4

(this is of course grub2, which is called just grub for several years now)

Added: output of sudo blkid /dev/sda*. As one can see, the 3 partitions do have different UUIDs, but here it is so that readers can check for themselves..

sudo blkid /dev/sda*
/dev/sda: PTUUID="5adeb302-3e17-421e-aabc-41bb2377a86f" PTTYPE="gpt"
/dev/sda1: LABEL_FATBOOT="EASY2BOOT" LABEL="EASY2BOOT" UUID="3C18-9DDC" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Microsoft basic data" PARTUUID="2d2d85db-6382-43f5-9166-1d31da742e06"
/dev/sda2: LABEL="X.SSD./root-ub22" UUID="8d66f7b3-dc29-40b1-b0f0-06105da0ddde" BLOCK_SIZE="4096" TYPE="ext4" PTTYPE="dos" PARTLABEL="Linux filesystem" PARTUUID="c5a10849-2f94-4917-9e56-cc5e594da0ee"
/dev/sda3: LABEL="X.SSD./root-ub21" UUID="d92b1ba1-ede6-4ba4-8f43-cfd7b89d4157" BLOCK_SIZE="4096" TYPE="ext4" PTTYPE="dos" PARTLABEL="Linux filesystem" PARTUUID="27fdc527-1e9b-4b77-a49e-dd92299b2ec7"
/dev/sda4: LABEL="X.SSD./root-ub20" UUID="4cc88374-3255-475b-be75-59ab2c462934" BLOCK_SIZE="4096" TYPE="ext4" PTTYPE="dos" PARTUUID="a2aeaf9e-4ecc-473e-8c8e-e82e16dc7846"
/dev/sda5: UUID="1D3E-50B4" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="4cc2c6b3-9678-4819-a18a-139ceecebb94"


You must log in to answer this question.

Browse other questions tagged .