Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 231684 - grub-install started with --no-floppy tries to access fd0 if it already exists in device.map
Summary: grub-install started with --no-floppy tries to access fd0 if it already exist...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-13 13:36 UTC by Paul Osmialowski
Modified: 2008-11-06 23:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Osmialowski 2008-07-13 13:36:45 UTC
After recent upgrade of grub, I've started such command:
grub-install --no-floppy /dev/hda
After about half an hour of proceeding, I got worried about it. I logged in another shell session in order to read kernel message. That's what dmesg has shown:
[847475.613392] end_request: I/O error, dev fd0, sector 0
[847487.744803] end_request: I/O error, dev fd0, sector 0
[847499.877096] end_request: I/O error, dev fd0, sector 0
[847499.877105] Buffer I/O error on device fd0, logical block 0
[847512.013986] end_request: I/O error, dev fd0, sector 0
[847512.013995] Buffer I/O error on device fd0, logical block 0
[862871.822355] end_request: I/O error, dev fd0, sector 0
[862883.958035] end_request: I/O error, dev fd0, sector 0
[862896.090598] end_request: I/O error, dev fd0, sector 0
[862896.090608] Buffer I/O error on device fd0, logical block 0
[862908.218479] end_request: I/O error, dev fd0, sector 0
[862908.218488] Buffer I/O error on device fd0, logical block 0
[862920.546527] end_request: I/O error, dev fd0, sector 0
[862932.692391] end_request: I/O error, dev fd0, sector 0
[862944.846730] end_request: I/O error, dev fd0, sector 0
[862944.846739] Buffer I/O error on device fd0, logical block 0
[862956.974914] end_request: I/O error, dev fd0, sector 0
[862956.974923] Buffer I/O error on device fd0, logical block 0
[862969.371171] end_request: I/O error, dev fd0, sector 0
[862981.498915] end_request: I/O error, dev fd0, sector 0
[862993.630921] end_request: I/O error, dev fd0, sector 0
[862993.630930] Buffer I/O error on device fd0, logical block 0
[863005.759944] end_request: I/O error, dev fd0, sector 0
[863005.759954] Buffer I/O error on device fd0, logical block 0
[863018.079273] end_request: I/O error, dev fd0, sector 0
[863030.207088] end_request: I/O error, dev fd0, sector 0
[863042.343933] end_request: I/O error, dev fd0, sector 0
[863042.343943] Buffer I/O error on device fd0, logical block 0
[863054.476540] end_request: I/O error, dev fd0, sector 0
[863054.476549] Buffer I/O error on device fd0, logical block 0
[863066.830523] end_request: I/O error, dev fd0, sector 0
[863078.959362] end_request: I/O error, dev fd0, sector 0
[863091.087745] end_request: I/O error, dev fd0, sector 0
[863091.087754] Buffer I/O error on device fd0, logical block 0
[863103.219703] end_request: I/O error, dev fd0, sector 0
[863103.219713] Buffer I/O error on device fd0, logical block 0
I guess --no-floppy option is just ignored.
I don't have floppy drive on this PC-compatible host.


Reproducible: Always

Steps to Reproduce:
1. build a regular PC but don't install FDD
2. install gentoo
3. run grub-install with --no-floppy option

Actual Results:  
grub-install process freeze

Expected Results:  
oposite to actual results

[ebuild   R   ] sys-boot/grub-0.97-r6  USE="ncurses -custom-cflags -netboot -static"
Comment 1 Paul Osmialowski 2008-07-13 13:39:17 UTC
After another 10 minutes grub-install finally finished its job with these messages:
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0)   /dev/fd0
(hd0)   /dev/hda
(hd1)   /dev/hdb
(hd2)   /dev/hdc
(hd3)   /dev/sda
(hd4)   /dev/sdb
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-11-05 22:35:46 UTC
Please test 0.97-r8 that is in package.mask very carefully (aka have a livecd
handy), but this should now be fixed.
Comment 3 Paul Osmialowski 2008-11-06 20:02:46 UTC
(In reply to comment #2)
> Please test 0.97-r8 that is in package.mask very carefully (aka have a livecd
> handy), but this should now be fixed.
> 

It didn't change anything:
 * Messages for package sys-boot/grub-0.97-r8:

 *
 * To avoid automounting and autoinstalling with /boot,
 * just export the DONT_MOUNT_BOOT variable.
 *
 * To interactively install grub files to another device such as a USB
 * stick, just run the following and specify the directory as prompted:
 *    emerge --config =grub-0.97-r8
 * Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell
 * grub where to install in a non-interactive way.
 * *** IMPORTANT NOTE: you must run grub and install
 * the new version's stage1 to your MBR.  Until you do,
 * stage1 and stage2 will still be the old version, but
 * later stages will be the new version, which could
 * cause problems such as an unbootable system.
 * This means you must use either grub-install or perform
 * root/setup manually! For more help, see the handbook:
 * http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#grub-install-auto
 * Regenerating GNU info directory index...
 * Processed 326 info files.
vlab ~ # grub-install --no-floppy /dev/hda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0)   /dev/fd0
(hd0)   /dev/hda
(hd1)   /dev/hdb
(hd2)   /dev/hdc
(hd3)   /dev/sda
(hd4)   /dev/sdb

dmesgs:
[2448146.872405] end_request: I/O error, dev fd0, sector 0
[2448163.660866] end_request: I/O error, dev fd0, sector 0
[2448180.395468] end_request: I/O error, dev fd0, sector 0
[2448180.395478] Buffer I/O error on device fd0, logical block 0
[2448197.072607] end_request: I/O error, dev fd0, sector 0
[2448197.072617] Buffer I/O error on device fd0, logical block 0
[2448325.244083] end_request: I/O error, dev fd0, sector 0
[2448342.094667] end_request: I/O error, dev fd0, sector 0
[2448358.784569] end_request: I/O error, dev fd0, sector 0
[2448358.784579] Buffer I/O error on device fd0, logical block 0
[2448375.602946] end_request: I/O error, dev fd0, sector 0
[2448375.602956] Buffer I/O error on device fd0, logical block 0
[2448392.911090] end_request: I/O error, dev fd0, sector 0
[2448409.686341] end_request: I/O error, dev fd0, sector 0
[2448426.597007] end_request: I/O error, dev fd0, sector 0
[2448426.597018] Buffer I/O error on device fd0, logical block 0
[2448443.454663] end_request: I/O error, dev fd0, sector 0
[2448443.454674] Buffer I/O error on device fd0, logical block 0
[2448460.606556] end_request: I/O error, dev fd0, sector 0
[2448477.529950] end_request: I/O error, dev fd0, sector 0
[2448494.355270] end_request: I/O error, dev fd0, sector 0
[2448494.355280] Buffer I/O error on device fd0, logical block 0
[2448511.302585] end_request: I/O error, dev fd0, sector 0
[2448511.302595] Buffer I/O error on device fd0, logical block 0
[2448528.758296] end_request: I/O error, dev fd0, sector 0
[2448545.581905] end_request: I/O error, dev fd0, sector 0
[2448562.474381] end_request: I/O error, dev fd0, sector 0
[2448562.474391] Buffer I/O error on device fd0, logical block 0
[2448579.285639] end_request: I/O error, dev fd0, sector 0
[2448579.285649] Buffer I/O error on device fd0, logical block 0
[2448596.669424] end_request: I/O error, dev fd0, sector 0
[2448613.487415] end_request: I/O error, dev fd0, sector 0
[2448630.280344] end_request: I/O error, dev fd0, sector 0
[2448630.280354] Buffer I/O error on device fd0, logical block 0
[2448647.139745] end_request: I/O error, dev fd0, sector 0
[2448647.139755] Buffer I/O error on device fd0, logical block 0
[2448664.207069] end_request: I/O error, dev fd0, sector 0
[2448680.993059] end_request: I/O error, dev fd0, sector 0
[2448697.692471] end_request: I/O error, dev fd0, sector 0
[2448697.692482] Buffer I/O error on device fd0, logical block 0
[2448714.479697] end_request: I/O error, dev fd0, sector 0
[2448714.479707] Buffer I/O error on device fd0, logical block 0
[2448731.640197] end_request: I/O error, dev fd0, sector 0
[2448748.388278] end_request: I/O error, dev fd0, sector 0
[2448764.884864] end_request: I/O error, dev fd0, sector 0
[2448764.884875] Buffer I/O error on device fd0, logical block 0
[2448781.669230] end_request: I/O error, dev fd0, sector 0
[2448781.669240] Buffer I/O error on device fd0, logical block 0
[2448798.688534] end_request: I/O error, dev fd0, sector 0
[2448815.464056] end_request: I/O error, dev fd0, sector 0
[2448832.097098] end_request: I/O error, dev fd0, sector 0
[2448832.097108] Buffer I/O error on device fd0, logical block 0
[2448848.870716] end_request: I/O error, dev fd0, sector 0
[2448848.870728] Buffer I/O error on device fd0, logical block 0
[2448865.902721] end_request: I/O error, dev fd0, sector 0
[2448882.610951] end_request: I/O error, dev fd0, sector 0
[2448899.378463] end_request: I/O error, dev fd0, sector 0
[2448899.378474] Buffer I/O error on device fd0, logical block 0
[2448916.046073] end_request: I/O error, dev fd0, sector 0
[2448916.046083] Buffer I/O error on device fd0, logical block 0
[2448933.172141] end_request: I/O error, dev fd0, sector 0
[2448949.859368] end_request: I/O error, dev fd0, sector 0
[2448966.517502] end_request: I/O error, dev fd0, sector 0
[2448966.517514] Buffer I/O error on device fd0, logical block 0
[2448983.036860] end_request: I/O error, dev fd0, sector 0
[2448983.036870] Buffer I/O error on device fd0, logical block 0
[2449000.017971] end_request: I/O error, dev fd0, sector 0
[2449016.820062] end_request: I/O error, dev fd0, sector 0
[2449033.535707] end_request: I/O error, dev fd0, sector 0
[2449033.535717] Buffer I/O error on device fd0, logical block 0
[2449050.339578] end_request: I/O error, dev fd0, sector 0
[2449050.339589] Buffer I/O error on device fd0, logical block 0
[2449067.474226] end_request: I/O error, dev fd0, sector 0
[2449084.358187] end_request: I/O error, dev fd0, sector 0
[2449101.175603] end_request: I/O error, dev fd0, sector 0
[2449101.175614] Buffer I/O error on device fd0, logical block 0
[2449117.865047] end_request: I/O error, dev fd0, sector 0
[2449117.865059] Buffer I/O error on device fd0, logical block 0
[2449135.171176] end_request: I/O error, dev fd0, sector 0
[2449151.646069] end_request: I/O error, dev fd0, sector 0
[2449168.525803] end_request: I/O error, dev fd0, sector 0
[2449168.525813] Buffer I/O error on device fd0, logical block 0
[2449185.309451] end_request: I/O error, dev fd0, sector 0
[2449185.309461] Buffer I/O error on device fd0, logical block 0
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-11-06 21:11:15 UTC
Could you please trace down if grub-install or grub itself is causing the fd0 access? Also, remove the fd0 line from your device.map.
Comment 5 Paul Osmialowski 2008-11-06 23:02:04 UTC
(In reply to comment #4)
> Could you please trace down if grub-install or grub itself is causing the fd0
> access? Also, remove the fd0 line from your device.map.
> 

I don't have any ideas how can I trace down this. The only evidence that grub-install tried to access FDD are those kernel messages.

I've removed fd0 line from /boot/grub/device.map line and it helped - grub-install now is running as expected:
vlab ~ # grub-install --no-floppy /dev/hda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)   /dev/hda
(hd1)   /dev/hdb
(hd2)   /dev/hdc
(hd3)   /dev/sda
(hd4)   /dev/sdb

We may say this solved the problem, but I cannot agree: if I say no-floppy then grub-install should not access fd0 even if it is listed in any configuration file.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-11-06 23:27:38 UTC
Ah, ok, I traced it.

Since fd0 already existed in the device.map, and once the device.map file exists, it is only appended to inside grub, never recreated (until you delete it either manually or with --recheck to grub-install).

I don't think ignoring parts of the existing device.map are a good idea, but if you want to write a patch to do so, look at lib/device.c, in the read_device_map function. At the end of the function when it appends to the map variable, you'd have to skip if the conditions are met for not using floppies. I'm not 100% sure that's all the spots however.

Upstream isn't doing any more development for grub-0.9x, so either write the patch yourself, or just ignore the errors in dmesg since they are harmless (and your BIOS floppy stuff is broken, mine returns in under 10 seconds).