[Bug 830636] New: Installation fails, if forcing "mount by label" with separate /boot partition
https://bugzilla.novell.com/show_bug.cgi?id=830636 https://bugzilla.novell.com/show_bug.cgi?id=830636#c0 Summary: Installation fails, if forcing "mount by label" with separate /boot partition Classification: openSUSE Product: openSUSE Factory Version: 13.1 Milestone 3 Platform: x86-64 OS/Version: openSUSE 12.3 Status: NEW Severity: Major Priority: P5 - None Component: Bootloader AssignedTo: mchang@suse.com ReportedBy: mge@suse.com QAContact: jsrain@suse.com CC: jsrain@suse.com, stefan.fent@suse.com Found By: Product Management Blocker: --- Setting: I am always using "mount by label", and I did so successfully up and including openSUSE 12.3. My standard partitioning scheme also includes a separate /boot partition. When trying to use the same setup with openSUSE 13.1 M3, I run into (multiple?) grub2 errors: 1. copied y2log: /usr/sbin/grub2-bios-setup: warning: Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet.. /usr/sbin/grub2-bios-setup: error: embedding is not possible, but this is required for cross-disk install. 2. copied from perl-BL-standalone-log: 2013-07-22 16:23:23 <1> yast-6028.1 Core::RunCommand.1641: run /usr/sbin/grub2-set-default '0' >/var/log/YaST2/y2log_bootloader 2>&1 - ret 32512 + output: sh: /usr/sbin/grub2-set-default: No such file or directory 2013-07-22 16:23:23 <3> yast-6028.1 Core::RunCommand.1642: Error: Command '/usr/sbin/grub2-set-default '0' >/var/log/YaST2/y2log_bootloader 2>&1' failed with code 32512 and output: sh: /usr/sbin/grub2-set-default: No such file or directory I have copied the full /log directory, if necessary. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c2
Michael Chang
Setting: I am always using "mount by label", and I did so successfully up and including openSUSE 12.3. My standard partitioning scheme also includes a separate /boot partition.
When trying to use the same setup with openSUSE 13.1 M3, I run into (multiple?) grub2 errors:
1. copied y2log:
/usr/sbin/grub2-bios-setup: warning: Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet.. /usr/sbin/grub2-bios-setup: error: embedding is not possible, but this is required for cross-disk install.
This usually happens when grub2 detects /boot and / is not on the same disk and attempting to install bootloader to /boot partition. The blocklist installation is used in such cases to locate core.img but the %dl is set (by the mbr code or whatever it's parent boot code chainloading it) to the drive device where the /boot partition resides, therefore it can't locate core.img on other disk device. If your /boot and / did on the same disk, one possible cause is /boot/grub2/device.map contains wrong or obsoleted device mapping which's using kernel device name. We had a bug report related to it and can be solved by using persistent device naming in device.map. bnc#821763 Have you rearranged your disk recently ?
2. copied from perl-BL-standalone-log:
2013-07-22 16:23:23 <1> yast-6028.1 Core::RunCommand.1641: run /usr/sbin/grub2-set-default '0' >/var/log/YaST2/y2log_bootloader 2>&1 - ret 32512 + output: sh: /usr/sbin/grub2-set-default: No such file or directory
2013-07-22 16:23:23 <3> yast-6028.1 Core::RunCommand.1642: Error: Command '/usr/sbin/grub2-set-default '0' >/var/log/YaST2/y2log_bootloader 2>&1' failed with code 32512 and output: sh: /usr/sbin/grub2-set-default: No such file or directory
Above grub2-set-default message were harmless but very much misguided. It should be fixed in my latest SR to perl-bootloader github repo by moving it to more appropriate place for executing commands.
I have copied the full /log directory, if necessary.
If your cases are not we're talking about, would be much more helpful if you could upload them for diagnose further. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c3
--- Comment #3 from Matthias Eckermann
This usually happens when grub2 detects /boot and / is not on the same disk and attempting to install bootloader to /boot partition. The blocklist installation is used in such cases to locate core.img but the %dl is set (by the mbr code or whatever it's parent boot code chainloading it) to the drive device where the /boot partition resides, therefore it can't locate core.img on other disk device.
While there is a second disk, both partitions, "/" and "/boot" are on the same /dev/sda.
If your /boot and / did on the same disk, one possible cause is /boot/grub2/device.map contains wrong or obsoleted device mapping which's using kernel device name. We had a bug report related to it and can be solved by using persistent device naming in device.map.
bnc#821763
Have you rearranged your disk recently ?
It's a notebook with an SSD as /dev/sda and a miniPCIe SDD as /dev/sdb Probably this causes issues!? [...]
If your cases are not we're talking about, would be much more helpful if you could upload them for diagnose further.
Will do in a minute. Thanks! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c4
--- Comment #4 from Matthias Eckermann
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c6
--- Comment #6 from Jiri Srain
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c7
--- Comment #7 from Michael Chang
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c8
--- Comment #8 from Michael Chang
The device map shows /dev/sdc (I assume that this is the USB disk you boot from) as the first disk. You should adjust the disk order during the installation.
Yes. I second your conclusions. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c9
Matthias Eckermann
Something I still not understand:
1. Why is your device.map uses kernel device names, In 12.3 it should have been switched to by-id names already.
I don't know.
2. The error message suggests that bootloader failed to install to your usb card's MBR that I first time see such failure [3].
"warning: Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet.."
Relevant logs are below.
[1]
(hd1) /dev/sda (hd0) /dev/sdc (hd2) /dev/sdb
/dev/sdc is the SD card which I am using to install from, in other words, the device where the 13.1 ISO is dd'ed to. Probably this is the issue? Looking at this again, it seems that there always might be situations where the bootloader configuration needs human help to decide, which disk is "the right" to install to. That said, should we close this as "won't fix" or do you want to investigate further? Thanks - MgE -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c10
--- Comment #10 from Jiri Srain
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c11
--- Comment #11 from Michael Chang
/dev/sdc is the SD card which I am using to install from, in other words, the device where the 13.1 ISO is dd'ed to. Probably this is the issue?
I think so. And bios assign it as (hd0) (disk with bios id 0x80) thus the "install to MBR" directed to that device. The mbr device is usually the boot device (or the first device in your bios boot order ..). Its really difficult to predict how bios would behavior.
Looking at this again, it seems that there always might be situations where the bootloader configuration needs human help to decide, which disk is "the right" to install to. That said, should we close this as "won't fix" or do you want to investigate further?
Yes. I think that's the reason why we providing the "change disk order" function in yast2 bootloader to circumvent the situations. Thanks, Michael -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c12
--- Comment #12 from Michael Chang
In principle, we could remove from the device map the disk, which was used to boot the installation. But, what if it in the end is the disk (installation on different partition)?
YaST can do some heuristics to decide the disk order, but it will never be 100% reliable. Perhaps Steffen could look at this bug and find an easy way for some improvement before closing it?
It's really difficult to say. device.map is used by Grub to map grub device to os device. And grub device (hd0) is the drive with bios_id 0x80 and (hd1) is 0x81 and so on. YaST2 is therefore responsible to create the correct map for Grub to function properly to have identical usage of device by bios and by os. In Grub2, the situation is a little bit different as it ships user-land utilities (grub2-probe) which can figure out the os and bios device mapping and therefore device.map is not necessary **for most cases** [1] . You can feed os device names (like /dev/sd[a-z][0-9]* or /dev/disk/by-id/...) directly and the installation scripts will figure out the device naming (like (hd0,msdos1) to be used by grub.cfg. In this case, it's pretty ugly. As the mbr device seems to be assigned to sdc somehow and we need to redefine in device.map to get the result we want .. [1] If /boot/grub2/device.map presents, grub2-probe will honer this static map and not trying to figure out the map dynamically. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c13
Michael Chang
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c14
Steffen Winterfeldt
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c15
Michael Chang
1. We shouldn't reference devices in device.map that aren't involved in the boot process at all (like sdc in this example).
I think we should not create and refer to any device.map unless the reason is known. We should use grub2-probe to tell us the mapping if we want to reference devices in the config (which's already done by grub2-mkconfig). The result is the most accurate to the device used by grub2 to represent device, as the implementation is common to grub2-util and grub2-core (grub2 is self contained .). The device.map is used in tricky or in workaround cases, among other things, like buggy bios which seems to report wrong disk number (such like this case .) And I vaguely remember there's a bug report that seem to point to deivce.map created by YaST is wrong that mess the situation even more.
2. mbr, boot loader and /boot partition on different disks is fancy but leads to all kinds of practical problems. Can't we just limit ourselves to putting all three on a single disk and warn the user that she has to check the config manually otherwise? I think grub2 is technically fine without any device map in this case. Well, you can use 'search' to find /boot, even.
I have no problem in putting restrictions on wild scenarios to what we can or like to control. To be more clear I think you are referring to three kinds device (for leagcy) 1. install device where you put grub2's boot.S or core.img (lzma compressed) if the device and|or filesystem supports embedding and have enough space. 2. boot device where we put kernel/initrd and grub2 modules and core.img 3. root device where system root file system resides Usually installation of bootloader means to decide #1 which has to take #2 into account. I think grub2 supports cross disk which among other features requires embedding core.img in install device. The current YaST can't handle it well as it's based on the grub implementation to propose the partitions and bootloader locations. And it lacks integration of grub2-utils in figuring out the correct setup and/or detect errors.
3. If at all, don't use bare kernel device names.
Yes.
4. grub2 has this nice 'search' feature where you don't have to deal with partition names at all (in theory). Maybe we should go more in that direction?
It's nice but it requires core.img be loaded and running (And usually such device or partition name problem leads to your install device not right and can't be fixed by search ..)
5. At least our own images, when put on a usb disk, will boot the 'next' disk device when left alone (ok, in theory; we have the infrastucture for that but only kiwi images use it, I think). So it would be pointless to overwrite the mbt there _unless_ (see 2.) the user also puts /boot on that disk.
Sorry I cannot understand above point. :( Thanks, Michael -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c16
Michael Chang
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c17
--- Comment #17 from Matthias Eckermann
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c19
Matthias Eckermann
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c20
--- Comment #20 from Michael Chang
Booted via USB into the rescue system:
# grub2-probe --target=hints_string --device `readlink --canonicalize /dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S1ATNEAD553289X`
--hint-bios=hd0 --hint-efi=hd0 --hint-baremetal=ahci0
Ok. So it is pretty enough to know that the SSD is the (hd0) device for grub. The install to MBR option should point to it. However using the device.map created by YaST2 overruled it. We have to check YaST in how it creates the device.map ..
To reconfirm, yes, the last |--hint='hd0'| is missing here
Yeah. It needs further clarification but I think above output is enough. Thanks. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c21
--- Comment #21 from Michael Chang
To reconfirm, yes, the last |--hint='hd0'| is missing here
The --hint is the device defined by device.map and therefore overrules the default --hint-bios device. If you don't have /boot/grub2/device.map it will not be displayed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c
Alberto Planas Dominguez
https://bugzilla.novell.com/show_bug.cgi?id=830636
https://bugzilla.novell.com/show_bug.cgi?id=830636#c22
Michael Chang
participants (1)
-
bugzilla_noreply@novell.com