[dm-devel] [PATCH] Support HDIO_GETGEO on device-mapper volumes
Darrick J. Wong
djwong at us.ibm.com
Fri Feb 10 01:35:12 UTC 2006
Hi again,
I'm trying to install grub on a device-mapper RAID1 array that I set up
via dmraid (in other words, a bootable software fakeraid). Since dm
doesn't implement the HDIO_GETGEO ioctl, grub assumes that the CHS
geometry is 620/128/63, which makes it impossible to configure it to
boot a filesystem that lives beyond the 2GB mark, even if the system
BIOS supports that.
The attached patch implements a simple ioctl handler that supplies a
compatible geometry when HDIO_GETGEO is called against a device-mapper
device. Its behavior is somewhat similar to what sd_mod does if the
scsi controller doesn't provide its own geometry. Granted, the notion
of cylinders, heads and sectors is silly on a RAID array, but with this
patch, interested programs can obtain CHS data that's somewhat close to
correct; this seems to be a better option than having each program make
up its own potentially different geometry, or making an arbitrary guess.
Assuming that all of the programs that need to know CHS geometry will
query the kernel via HDIO_GETGEO, this patch makes it so that all of
those programs end up using the same geometry.
The patch applies cleanly against 2.6.15.3; if there aren't any
objections then I'm submitting this for upstream. However, I'm all ears
for suggestions.
Signed-off-by: Darrick J. Wong <djwong at us.ibm.com>
--Darrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dm-getgeo_1.patch
Type: text/x-patch
Size: 1751 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20060209/f744f54b/attachment.bin>
More information about the dm-devel
mailing list