Bugzilla – Bug 146095
mkinitrd bugs for root filesystem on LVM
Last modified: 2006-01-30 13:33:54 UTC
+++ This bug was initially created as a copy of Bug #145928 +++ After reboot (directly after the first stage of the installation), I'm faced with the error message "not found -- exiting to /bin/sh". The kernel can't find its root filesystem because the vgchange binary isn't in the initrd. And mkinitrd has a VERY subtle bug where a file from /proc is read in the following way: while read a b; do // something done </proc/devices That fails (actually, only the first few bytes will be read) because the file is on /proc! Never assume files in /proc can be handled the normal way. You need cat to read them completely. After fixing that bug in my local sources, at least mkinitrd recognized it had a root filesystem on LVM. However, it included everything except dmsetup in the initrd, so the boot failed again. To reproduce the mkinitrd problem, try this script. It will only show you the first 2 lines of /proc/devices. Since /proc/devices is has listed 0 bytes as size, it is debatable whether that is an ash bug. #!/bin/ash while read a; do echo $a done </proc/devices mkinitrd, function block_driver, line 742 suffers from that ash quirk. Even when all of the bugs above are corrected, there is another problem. My LVM setup has been created with 10.0 and 10.1beta2 thinks this is an LVM2 setup and doesn't run "vgchange -a y".
I've fixed up mkinitrd to now read: major=$(devmajor $devn) driver=$(cat /proc/devices | sed -n "s/^[ ]*$major \(.*\)/\1/p;/Block/p" | tail -1) case "$driver" in Block*) return 1 ;; *) echo $driver return 0 ;; esac
And I'v added a call to vgchange even for the LVM2 case. dmsetup is now also included.
Great! Could you attach the current mkinitrd to this bug so I can test it?