Bug 799457

Summary: Grub fails to build a working menu for other Linux OS
Product: [openSUSE] openSUSE Tumbleweed Reporter: Carl Fletcher <caf4926>
Component: BasesystemAssignee: E-mail List <bnc-team-screening>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: arvidjaar, bwiedemann, forgotten_K-uAvjqJ3n, hepet, hloeffler3
Version: 13.1 Beta 1   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: Community User Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: 12.3 grub.cfg
12.2 grub.cfg rebuild after 12.3 install

Description Carl Fletcher 2013-01-19 04:36:15 UTC
Created attachment 520985 [details]
12.3 grub.cfg

Using Gnome Live CD _64
Proper install to HD with other OS's (Mint, openSUSE 12.2)
Neither Mint 14 or openSUSE 12.2 would boot from the menu built by 12.3 Grub
12.3 itself boots fine

So what I have done is. Made a copy of the original menu produced by 12.3
I'll attach it here

I repaired grub by chroot to 12.2  and rebuilt grub there. It picked up 12.3 and it works, as you would expect. I'll attach the menu built by 12.2 too for comparison.

Now to what happened when you tried booting with the menu built by 12.3
My bad, I didn't take notes. But it complained IIRC about video modes.
Comment 1 Carl Fletcher 2013-01-19 04:40:37 UTC
Created attachment 520986 [details]
12.2 grub.cfg rebuild after 12.3 install

Repaired booting after install of 12.3 by repairing 12.2
Included it's menu for comparison
Comment 2 Andrei Borzenkov 2013-01-19 06:07:17 UTC
initrd is missing:

	linux /boot/vmlinuz-3.5.0-17-generic root=UUID=a8fc2c66-21ec-43bd-ac47-0c6bc68e81f6 ro quiet splash $vt_handoff
	initrd ro

Could you please run "grub2-mkconfig -o /dev/null" and attach /var/log/messages during this run? os-prober logs to syslog. At least, I hope they will appear in syslog ...
Comment 3 Carl Fletcher 2013-01-19 13:01:37 UTC
/var/log/messages

http://paste.opensuse.org/2802137
Comment 4 Andrei Borzenkov 2013-01-19 14:00:17 UTC
Please test:

zypper ar obs://home:arvidjaar:bnc:799457/openSUSE_Factory bnc799457
zypper refresh bnc799457
zypper dup -r bnc799457

And retry grub2-mkconfig
Comment 5 Carl Fletcher 2013-01-19 14:44:08 UTC
I notices in the terminal feedback it didn't pick up Mint 14 this time
http://paste.opensuse.org/90450708

My guess is it would if I mounted the Mint root

Also, just to say, so far I didn't actually test the result by installing grub again for 12.3
Let me know if you want that?
Comment 6 Andrei Borzenkov 2013-01-19 15:29:03 UTC
(In reply to comment #5)
> I notices in the terminal feedback it didn't pick up Mint 14 this time

That's correct, it won't pick up entries that were added by (another) os-prober. It assumes they were added by os-prober if entry ends with "(on /dev/XXX").

There was yet another glitch, could you check please.

zypper refresh
zypper up os-prober
Comment 7 Carl Fletcher 2013-01-19 16:24:28 UTC
http://paste.opensuse.org/25963311
Comment 8 Andrei Borzenkov 2013-01-19 17:05:10 UTC
(In reply to comment #7)
> http://paste.opensuse.org/25963311

Am I right that you have additional OS on /dev/sda5 and this OS is missing in generated menu? This is the same as in bnc#767272:

2013-01-19T16:06:45.940791+00:00 gnome-123 kernel: [  257.698952] EXT4-fs (sda5): INFO: recovery required on readonly filesystem
2013-01-19T16:06:45.940844+00:00 gnome-123 kernel: [  257.698961] EXT4-fs (sda5): write access unavailable, cannot proceed

May I ask you to manually mount and cleanly unmount /dev/sda5 and repeat the test. We need to verify that original bug (incorrect initrd) is indeed fixed.
Comment 9 Andrei Borzenkov 2013-01-19 17:09:36 UTC
Before remounting - could you check whether grub2-mount is capable of mounting this filesystem:

grub2-mount /dev/sda5 /tmp/mnt
Comment 10 Carl Fletcher 2013-01-19 17:25:30 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > http://paste.opensuse.org/25963311
> 
> Am I right that you have additional OS on /dev/sda5 and this OS is missing in
> generated menu? This is the same as in bnc#767272:
> 
> 2013-01-19T16:06:45.940791+00:00 gnome-123 kernel: [  257.698952] EXT4-fs
> (sda5): INFO: recovery required on readonly filesystem
> 2013-01-19T16:06:45.940844+00:00 gnome-123 kernel: [  257.698961] EXT4-fs
> (sda5): write access unavailable, cannot proceed
> 
> May I ask you to manually mount and cleanly unmount /dev/sda5 and repeat the
> test. We need to verify that original bug (incorrect initrd) is indeed fixed.

Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     8450047     4224000   82  Linux swap / Solaris
/dev/sda2   *     8450048   488396799   239973376    5  Extended
/dev/sda5         8452096    52606975    22077440   83  Linux
/dev/sda6        52609024    97058815    22224896   83  Linux
/dev/sda7        97060864   243421183    73180160   83  Linux
/dev/sda8       243423232   387958783    72267776   83  Linux
/dev/sda9       387960832   488396799    50217984   83  Linux

Correct:
sda5 is Mint 14 root
sda6 is OS 12.2 root
sda9 is OS 12.3

Just before we proceed. Can I just mention that the original menu produced by 12.3 at install did have all OS's listed in the Menu. Only 12.3 booted though.

I'm struggling slightly with this because when I go su - in the terminal gnome-shell starts running at 50% and no apps will launch. If apps are already open they seem to keep working.

So can you just re-confirm how you want me to proceed now.
Comment 11 Andrei Borzenkov 2013-01-19 17:51:04 UTC
(In reply to comment #10)

> Just before we proceed. Can I just mention that the original menu produced by
> 12.3 at install did have all OS's listed in the Menu. Only 12.3 booted though.
> 

Well, apparently at this point filesystem was cleanly unmounted.

> 
> So can you just re-confirm how you want me to proceed now.

1. Please test grub2-mount if it works:

mkdir /tmp/mnt
grbu2-mount /dev/sda5 /tmp/mnt
ls -l /tmp/mnt
umount /tmp/mnt

May be grub2 is still capable of accessing filesystem in this conditions.

2. Try to clean error and re-run grub2-mkconfig

mount /dev/sda5 /tmp/mnt
umount /tmp/mnt (should now be clean)
grub2-mkconfig

and verify whether entries from /dev/sda5 are present and you can boot using them.
Comment 12 Carl Fletcher 2013-01-19 18:36:46 UTC
This just the terminal feedback, wasn't sure I did exactly what you wanted..?
http://paste.opensuse.org/71667853
Have not tested booting with it yet. Will be tomorrow before I can do that
Comment 13 Andrei Borzenkov 2013-01-19 19:00:01 UTC
Yes, looks good. Please, let me know when you tested booting.
Comment 14 Hans Löffler 2013-01-19 19:19:31 UTC
(In reply to comment #4)
> Please test:
> 
> zypper ar obs://home:arvidjaar:bnc:799457/openSUSE_Factory bnc799457
> zypper refresh bnc799457
> zypper dup -r bnc799457
> 
> And retry grub2-mkconfig



fixes grub.cfg for me as well (Ubuntu 12.04 on /dev/sda3, Opensuse 12.3 b2 on /dev/sdb4)
Comment 15 Forgotten User K-uAvjqJ3n 2013-01-19 23:26:45 UTC
with grub2 all of my additional operating systems the initrd line reads
initrd video 
I manually change the line to (hdx,msdosx)/boot/initrd-3.x.x.x-desktop(default) to boot
saw from Hans and did so the /boot/grub2/grub.cg looks good will reboot and see
Comment 16 Forgotten User K-uAvjqJ3n 2013-01-19 23:53:17 UTC
Worked for me
Comment 17 Carl Fletcher 2013-01-20 04:54:22 UTC
(In reply to comment #13)
> Yes, looks good. Please, let me know when you tested booting.

Booting failed with the following:

12.2
Invalid filename                        video1024x800

Mint
error
invalid filename  'ro'


So I made sure I was using the os-prober from bnc799457, I was.
I mounted 12.2 root and Mint root
Ran grub2-mkconfig
Tested and all was good.

Just mention, I assume it's the same for everyone. There is no pretty green suse boot splash at this stage
Comment 18 Andrei Borzenkov 2013-01-20 06:25:15 UTC
OK, submitted SR#149277. Mark as resolved.
Comment 19 Bernhard Wiedemann 2013-01-20 07:00:10 UTC
This is an autogenerated message for OBS integration:
This bug (799457) was mentioned in
https://build.opensuse.org/request/show/149278 Factory / os-prober
Comment 20 Andrei Borzenkov 2013-01-21 19:17:46 UTC
*** Bug 799663 has been marked as a duplicate of this bug. ***
Comment 21 Andrei Borzenkov 2013-01-23 15:19:26 UTC
*** Bug 800042 has been marked as a duplicate of this bug. ***
Comment 22 Jeff Mahoney 2014-06-19 22:43:57 UTC
Unfortunately, using grub2-mount by default introduces a problem. If there are more than a couple of devices, it can take minutes to complete.

On a system with ~ 12 partitions, it takes over 3 minutes to run os-prober when using grub2-mount. On that same system, it takes 10 seconds to run os-prober using kernel mounts. This several minute delay happens every time update-bootloader is run, which is several times during the installation process and when installing updates.
Comment 23 Jeff Mahoney 2014-06-19 23:03:20 UTC
It's less severe than that. It's more like:

10 seconds for kernel mounts
41 seconds for a modified grub2-mount that handles -t <fstype>
61 seconds for an unmodified grub2-mount
Comment 24 Jeff Mahoney 2014-06-20 13:39:45 UTC
Here's an even better case for disabling it by default:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701814

That report also mentions the (real) possibility that even read-only mounts will cause journal replays to occur. If the file system is mounted somewhere else, it will corrupt it. The use of grub2-mount is a "true" read-only mount, but then we're stuck with the delays.