Comment 6 for bug 554307

Revision history for this message
V[i]ctor (sadkov993) wrote :

Yes, the bug appears on 14.04 LTS release. The partition in question is not mounted via /etc/fstab.

To understand what's going on I'd better give you blkid output with some my comments:

$ blkid /dev/sda*
/dev/sda1: UUID="66ECBF91ECBF5A4F" TYPE="ntfs"
/dev/sda10: UUID="04db7581-6256-408c-969b-27847b90f5e3" TYPE="ext4" # Ubuntu 14.04, my main OS, all the scripts I run, I run here
/dev/sda2: UUID="425ec35d-cc19-438a-aa30-ea3b0beee6ae" TYPE="ext4" # /boot partition for both Ubuntu systems
/dev/sda5: UUID="f728b87c-d0fa-4419-a55a-aee66dead3c4" TYPE="ext4" # old Ubuntu 10.04, I can't boot it because of the current bug (but I fixed grub.cfg later on)
/dev/sda6: UUID="b862754b-5a40-4412-87ac-eb7e846be4bb" TYPE="ext4" # my /home for both Ubuntus
/dev/sda7: UUID="e1eb1b01-8c1a-4237-85ec-e69255f2a73e" TYPE="ext4"
/dev/sda8: UUID="b30c59b6-fc31-4a06-b04b-a13d9f898c1c" TYPE="swap"
/dev/sda9: UUID="70EFAAAD68BA7261" TYPE="ntfs"

I also found that linux-boot-prober uses grub.cfg to get the data.

I ran it 3 times: without grub.cfg in /boot/grub/, with the grub.cfg generated by update-grub script (which uses linux-boot-prober, that's where this bug affects grub2 package) and with fixed by hand grub.cfg. You can see all 3 outputs in the attached file. (I have partial russian locale, so cyrillic с there stands for the word "with".)

You may also want to see my grub.cfg file before and after my fix. The old one wasn't saved, so I regenerated it running update-grub several times (it's a huge mess there right now). Both fixed one and regenerated one are in attachment.

As far as I found out, linux-boot-prober parses grub.cfg assuming there are no other operating systems which use the same /boot partition. When it does so, it just finds all linux menuentries and prints all them out, with root partitions from the corresponding menuentries.

So the actual bug is, linux-boot-prober prints out the wrong kernels from grub.cfg, and the update-grub script uses this incorrect data from linux-boot-prober to generate messed up grub.cfg. In the update-grub script there is actually no bug, just not super-safe-checking-everything behaviour, so I'll leave the bug from grub2 as a duplicate.