bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disk mapping confusion with the device command


From: Phillip Susi
Subject: Re: Disk mapping confusion with the device command
Date: Fri, 11 Nov 2005 10:40:36 -0500
User-agent: Thunderbird 1.5 (Windows/20051025)

Molle Bestefich wrote:
AFAIR, there's a nasty bug in Grub regarding the ordering of these commands.
Doing the above in opposite order may give you radically different results.

I ran into the same problem when I installed on my fakeraid.
Considered fixing it, but then didn't :-).


The bug seems to be that grub treats device (hd0) and device (hd0,4) as the same command. If you try to use the hd0,4 syntax in the devices.map file, it throws up a syntax error, but if you issue this command interactively, it accepts it, but incorrectly. If you issue the (hd0) command first, then the (hd0,4) one, the latter replaces the former so grub uses the wrong device. If you reverse the order, then grub uses the (hd0) command as it should, and the (hd0,4) command is replaced. Because of that simply leaving out the (hd0,4) command entirely works just as well.

It looks to me that grub only needs to be told the block device for the raw disk and it does all it's IO through that. It seems that there is a lot of confusion though as a lot of people believe that you can/should tell grub about each partition block device. This false belief is reinforced by the fact that grub accepts the command to map the partition, but interprets it as a command to map the entire disk.


Oh, there's a bug I actually fixed.  Easy too.
Problem is that HDIO_GETGEO won't work for device-mapper devices.

My patch could use a bit of TLC, for example it would be nice if it
worked with CHS mode too:
 * modprobe edd
 * match the device to /sys/firmware/edd/int13_??? and find BIOS idea
of correct nr. of heads (instead of defaulting to 255)

There's a couple of other nits too.
Doesn't seem like my fix is going to get into Grub anyway, so I
stopped working on it, heh.



Why isn't grub using the geometry contained in the MBR? Or guessing it the same way that fdisk did? Any disk that is over what? 2 gigs, is going to be using fake geometry anyhow, which means 255 heads, 63 sectors, and however many cylinders it takes to map the full length of the disk.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]