Bug 25073 - bootloader-config fails on non-existent unknown device
Summary: bootloader-config fails on non-existent unknown device
Status: RESOLVED WORKSFORME
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 7
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-08 12:56 CEST by Florian Hubold
Modified: 2019-07-08 15:41 CEST (History)
2 users (show)

See Also:
Source RPM: drakxtools-18.21-1.mga7.src.rpm
CVE:
Status comment:


Attachments

Description Florian Hubold 2019-07-08 12:56:40 CEST
Description of problem:

Saw this once during the upgrade to mga7 already, probably when one of the post-hooks tried to run bootloader-config, but I didn't gave much on it as the upgrade was still only half-complete. Now that the upgrade is complete, this still happens and prevents bootloader-config from completing its job.


[doktor5000@Mageia6]─[12:27:44]─[~] sudo LC_ALL=C bootloader-config --action rebuild-initrds
INTERNAL ERROR: unknown device sdd
MDK::Common::Various::internal_error() called from /usr/lib/libDrakX/devices.pm:131
devices::entry() called from /usr/lib/libDrakX/devices.pm:146
devices::make() called from /usr/lib/libDrakX/partition_table/raw.pm:60
partition_table::raw::typeOfMBR() called from /usr/lib/libDrakX/bootloader.pm:307
bootloader::read() called from /sbin/bootloader-config:64

[✗]─[doktor5000@Mageia6]─[12:27:54]─[~] sudo LC_ALL=C lsblk -f
NAME     FSTYPE LABEL             UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                                   
|-sda1                                                                                
`-sda2   ntfs   EXTERN5           A0CC037CCC034C4A                        411G    85% /run/media/doktor5000/EXTERN5
sdb                                                                                   
|-sdb1                                                                                
`-sdb2   ntfs   EXTERN6           EADE8A4CDE8A10CD                      543.7G    81% /run/media/doktor5000/EXTERN6
sdc                                                                                   
|-sdc1   ntfs   System-reserviert E4C06EF3C06ECAFE                       75.4M    25% /media/win_c
|-sdc2   ntfs                     7CDA724CDA7202A6                       21.2G    89% /media/win_d
|-sdc3                                                                                
|-sdc5   btrfs                    799cdaf8-b6af-4299-a6c9-c934027e3bdc    1.9G    88% /
|-sdc6   swap                     ec70e132-9c53-4851-a7cd-f89ba3c104b4                [SWAP]
`-sdc7   btrfs                    a6d498ba-009f-4ee0-8fee-1460f2622dba   82.8G    65% /home
sr0      udf    4BLOCKS_DVD01     d84ff5254150504c                                    
pktcdvd0                                                                              

[✗]─[doktor5000@Mageia6]─[12:29:54]─[~] ll /dev/sd?
brw-rw---- 1 root disk 8,  0 Jul  8 12:27 /dev/sda
brw-rw---- 1 root disk 8, 16 Jul  8 12:27 /dev/sdb
brw-rw---- 1 root disk 8, 32 Jul  8 12:27 /dev/sdc

I'm not sure where /usr/lib/libDrakX/devices.pm picks up sdd as no such device exists and I also don't find that anywhere under /etc. It could be about the sr0 or pktcdvd0 but this shouldn't prevent bootloader-config from completing.

FWIW, in comparison both dracut and update-grub2 work without issues.
Florian Hubold 2019-07-08 13:00:32 CEST

CC: (none) => doktor5000, rverschelde

Comment 1 Florian Hubold 2019-07-08 15:31:45 CEST
After checking a bit more, stumbled about the cause for this, it's /boot/grub2/install.sh which contains "grub2-install /dev/sdd" instead of "grub2-install". Although that has been there since Dec. 2017, and has not been an issue until now.


[doktor5000@Mageia6]─[15:23:40]─[~] sudo LC_ALL=C strace -f bootloader-config --action rebuild-initrds 2>&1 |grep sdd
read(4, "grub2-install /dev/sdd", 8192) = 22
stat("/dev/sdd", 0xc89478)              = -1 ENOENT (No such file or directory)
stat("/sys/block/sdd/dev", 0xc89478)    = -1 ENOENT (No such file or directory)
stat("/dev/sdd", 0xc89478)              = -1 ENOENT (No such file or directory)
write(2, "INTERNAL ERROR: unknown device s"..., 393INTERNAL ERROR: unknown device sdd
[doktor5000@Mageia6]─[15:23:54]─[~]

[doktor5000@Mageia6]─[15:24:45]─[~] ll /boot/grub2/install.sh
-rwxr-xr-x 1 root root 22 Dez  5  2017 /boot/grub2/install.sh*
[doktor5000@Mageia6]─[15:26:03]─[~] cat /boot/grub2/install.sh
grub2-install /dev/sdd
[doktor5000@Mageia6]─[15:27:31]─[~]

After removal of /dev/sdd from /boot/grub2/install.sh bootloader-config only returns: "Cannot find a boot loader installed" :/
Comment 2 Florian Hubold 2019-07-08 15:41:14 CEST
(In reply to Florian Hubold from comment #1)

> After removal of /dev/sdd from /boot/grub2/install.sh bootloader-config only
> returns: "Cannot find a boot loader installed" :/

Re-ran drakboot to reinstall grub2, now everythings working fine.
/boot/grub2/install.sh now contains the device selected in drakboot "grub2-install /dev/sdc". So it seems I changed bootloader location some time in the past and can't really remember, closing this one.

Resolution: (none) => WORKSFORME
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.