|
Bugzilla – Full Text Bug Listing |
| Summary: | Perl-Bootloader: (...) <3> pbl-1790.2 Core::GRUB2::GrubDev2UnixDev.252: Error: did not find a match for hd0 in the device map | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE Distribution | Reporter: | Ulrich Windl <Ulrich.Windl> |
| Component: | Bootloader | Assignee: | Steffen Winterfeldt <snwint> |
| Status: | RESOLVED FIXED | QA Contact: | Jiri Srain <jsrain> |
| Severity: | Major | ||
| Priority: | P5 - None | CC: | mchang, Ulrich.Windl |
| Version: | 13.2 | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | openSUSE 13.2 | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: | Relevant part of pbl.log | ||
|
Description
Ulrich Windl
2015-01-03 19:51:24 UTC
Good point. Michael, as the code was from you, the assumption https://github.com/openSUSE/perl-bootloader/blob/master/src/Core/GRUB2.pm#L130 is not safe. Looking at the sysfs tree like --- a/src/Core/GRUB2.pm +++ b/src/Core/GRUB2.pm @@ -127,7 +127,9 @@ sub GetDeviceMap { } # skip partitions, assume they were ended with digits - if ($kern_dev =~ /\d+$/) { + my $sys_dev = $kern_dev; + $sys_dev =~ s#/#!#; + if (!-d "/sys/block/$sys_dev") { $self->milestone ("skip partition $kern_dev in device map"); next GETMAP; } might work better. But I'm not at home with the grub2 device map code. :-) Thanks Steffen. Hi Ulrich, Could you please test the updated perl bootloader package from this repository ? http://download.opensuse.org/repositories/home:/michael-chang:/branches:/Base:/System/openSUSE_Factory/ Thanks. (In reply to Michael Chang from comment #2 "Could you please test...") Please be a little bit more verbose: What after I installed the package? Run "mkinitrd" or what? Hi Ulrich, You can try the commands to see is there any error messages. update-bootloader --refresh update-bootloader -reinit Thanks. (In reply to Steffen Winterfeldt from comment #1) > + $sys_dev =~ s#/#!#; I wonder: Shouldn't it be "$sys_dev =~ s#^.*/##;"? If the device is "/dev/md123" your command would make "!dev/md123" from it, while my command would make "md123". I didn't watch the whole context, but in /sys/block there are entries like "md123"... While at it, also fix the comment, because the code does something different than the comment suggests. The var holds the device name without '/dev/'. (In reply to comment #2 and comment #4) The suggested commands take quite some time, and the first one finished without output, while the second one (what is it supposed to do?) gave this output: Perl-Bootloader: 2015-01-08 20:01:00 <3> pbl-2016.2 Core::RunCommand.1658: Error: '/usr/sbin/grub2-install --target=i386-pc --force --skip-fs-probe "/dev/system/root"' failed with exit code 1, output: <<<<<<<<<<<<<<<< i386-pc wird für Ihre Plattform installiert. WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it! WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it! WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it! WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it! WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it! /usr/sbin/grub2-install: Warnung: Dateisystem »ext2« unterstützt keine Einbettungen. /usr/sbin/grub2-install: Warnung: Einbettung ist nicht möglich. GRUB kann in dieser Konfiguration nur mittels Blocklisten installiert werden. Blocklisten sind allerdings UNZUVERLÄSSIG und deren Verwendung wird daher nicht empfohlen.. /usr/sbin/grub2-install: Fehler: diskfilter writes are not supported. >>>>>>>>>>>>>>>> Was that the command to ruin my boot configuration? ;-) (In reply to Ulrich Windl from comment #7) > (In reply to comment #2 and comment #4) > The suggested commands take quite some time, and the first one finished > without output, while the second one (what is it supposed to do?) gave this > output: It (update-bootloader --reinit) is supposed to reintall your bootloader and also recreate bootloader config. > Perl-Bootloader: 2015-01-08 20:01:00 <3> pbl-2016.2 Core::RunCommand.1658: > Error: '/usr/sbin/grub2-install --target=i386-pc --force --skip-fs-probe > "/dev/system/root"' failed with exit code 1, output: > <<<<<<<<<<<<<<<< That's odd, the /dev/system/root definitely can't be the install device. And if it was how could it pass the installation and booted. What is your content of /etc/default/grub_installdevice ? Could you please attach it. And also please attach /var/log/pbl.log. Thanks. > Was that the command to ruin my boot configuration? ;-) I suppose Not, because it was failed and aborted .. (In reply to Michael Chang from comment #8) > That's odd, the /dev/system/root definitely can't be the install device. And > if it was how could it pass the installation and booted. --somewhat off-topic-- Well, when installing, I entered that selection in Yast, and Yast accepted it. At the end of the installation there was an error installing the bootloader, and somehow YaST ended with replacing my MBR boot code... As this is not what I wanted, I had started this query: https://forums.opensuse.org/showthread.php/502944-Adding-GRUB2-quot-boot-sector-quot-to-Windows-7-boot-manager-with-LUKS-enabled At the end I managed to install the GRUB2 bootloader in a way that Windows bootloader still works (I guess after the MBR before the first partition starts). I guess I did not adjust some configuration settings after that ---end off-topic--- > > What is your content of /etc/default/grub_installdevice ? Could you please > attach it. And also please attach /var/log/pbl.log. I don't have those here right now. Later. > > Was that the command to ruin my boot configuration? ;-) > > I suppose Not, because it was failed and aborted .. Unfortunately not: It replaced my MBR bootloader (Windows). I used my MBR backup to revert the change. Created attachment 619661 [details]
Relevant part of pbl.log
# cat /etc/default/grub_installdevice /dev/disk/by-id/md-uuid-2047fabb:aa594b5d:ff1519a1:7d0ff516 /dev/system/root (In reply to Ulrich Windl from comment #12) > # cat /etc/default/grub_installdevice > /dev/disk/by-id/md-uuid-2047fabb:aa594b5d:ff1519a1:7d0ff516 Fine, this is mbr disk devce on Intel Firmware Raid. > /dev/system/root Did your yast2 bootloader settings have enabled root partition as install device for grub2? Thanks. (In reply to Michael Chang from comment #13) > Did your yast2 bootloader settings have enabled root partition as install > device for grub2? Yes. (In reply to Ulrich Windl from comment #14) > (In reply to Michael Chang from comment #13) > > Did your yast2 bootloader settings have enabled root partition as install > > device for grub2? > > Yes. Did you enable it manually? If yes, why ? MBR is unable to chain-load loader image from lvm blocks. If the setting was not explicitly enabled by user, I wonder YaST did a wrong location proposal here. Anyway you should delete /dev/system/root in /etc/default/grub_installdevice and do the test again .. In reply to comment #15: I selected (it was allowed) to install the boot loader in the root partition (with the intention to chain-start that from the Windows bootloader), but during installation Yast also installed the bootloader to MBR, replacing the Windows boot loader. As said in comment #10, I managed to chain-load GRUB2 from Windows boot loader, and I want to keep it that way. I only wish a kernel update would not replace the windows bootloader again. I'm not sure what the requirements for a working configuration are (maybe a boot partition is OK, while a boot Logical Volume ist not). If you want to keep your Windows MBR, you need to create a boot partition without LVM and place grub2's boot.img (stage1) on that boot file system's reserved sector (usually the first sector) for bootloader. For direct LVM booting, MBR is required as we need to embed core.img on continuous sectors larger than 512 byte, which is offered by the gap between MBR and 1st partition, which is considered as extended from MBR. If no one objects, I'll push the patch in test package (comment#2) to Steffen and close this one. fix was fixed in Factory |