Bug#495049: why is (fd0) hard-coded into the grub image?

ian_bruce at fastmail.fm ian_bruce at fastmail.fm
Fri Aug 15 10:18:49 UTC 2008


I should point out that when grub drops into the rescue prompt, it
coughs up the message "error: unknown device fd0". Perhaps this is why
it goes into rescue mode?

My "device.map" file, as previously listed, does not contain an entry
for "fd0", because the machine does not in fact have a floppy
drive. Wondering if this might help, I added the entry "(fd0) /dev/fd0",
and reinstalled grub.

It did NOT help. Grub dropped into rescue mode as before, with the same
error message, but with the difference that this time the "pc" module
was not included in the core image, with the effect that the partition
table could not be read, rendering the machine completely unbootable. I
had to make use of a grub rescue CD to restart it.

I tried again, changing the "device.map" entry to "(fd0) /dev/sda", to
see if that would make it happy. It didn't. It still went into rescue
mode, with the same error message, but this time chose to include the
"pc" module again. So I was back where I started, booting the system
with "insmod normal".

Some questions suggest themselves:

-- why is there a hard-coded dependency on "fd0", when neither
"device.map" nor "grub.cfg" mention it?

-- is the "fd0" dependency the reason why grub drops into rescue mode?

-- why does adding an "fd0" entry to "device.map" not resolve this
error?

-- why does adding an "fd0" entry to "device.map" cause the "pc" module
to be omitted from the core image, when both "device.map" and "grub.cfg"
indicate that the system will be booted from a hard disk?

This problem seems to have some similarity with bug #494501, in that
something that is not really an error condition may be causing grub to
drop into rescue mode unnecessarily.

Finally, I suggest the following patch for clarifying exactly what
"grub-install" is doing, at least until some of these issues are
resolved.


--- grub-install        2008-08-10 11:39:26.000000000 -0700
+++ /usr/sbin/grub-install      2008-08-13 17:21:46.000000000 -0700
@@ -259,11 +259,18 @@
     prefix_drive=`$grub_probe --target=drive --device ${grub_device}`
 fi

+echo $grub_mkimage --output=${grubdir}/core.img \
+    --prefix=${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`/ \
+    $modules
+
 $grub_mkimage --output=${grubdir}/core.img \
     --prefix=${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`/ \
     $modules || exit 1

 # Now perform the installation.
+echo $grub_setup --directory=${grubdir} --device-map=${device_map} \
+    ${install_device}
+
 $grub_setup --directory=${grubdir} --device-map=${device_map} \
     ${install_device} || exit 1






More information about the Pkg-grub-devel mailing list