Comment 41 for bug 1237519

Revision history for this message
Colin Watson (cjwatson) wrote :

I investigated this with the aid of some kindly-provided remote access and gdb.

GRUB needs to be able to find the start sector of each partition within a disk in order to accurately match up OS-level devices with GRUB devices. On Linux, it uses the HDIO_GETGEO ioctl to do this; although most of the information returned by that ioctl is obsolete, it returns the start sector. Most Linux block device drivers implement this ioctl; unfortunately the FusionIO block device driver does not, and therefore GRUB has no way to safely identify /dev/fioa1.

Since this ioctl is typically rather easy to implement (you need to implement the "getgeo" member of block_device_operations), I think this should be fixed in the FusionIO driver. If you don't have meaningful cylinder/head/sector-type information to fill in, you can probably fake it up, perhaps in the same way that drivers/block/umem.c does. The start sector is filled in from generic code in block/ioctl.c.

There is only one other way I know of to get the start sector of a partition from userspace, and that's to read its "start" attribute from sysfs. However, that's considerably more cumbersome to do from C code, and I'd prefer to avoid that if at all possible. If you could add this fairly simple interface to the FusionIO driver, it would make things considerably easier. Alternatively, if there's some other interface you can suggest that's generic in Linux rather than being FusionIO-specific, I'd be happy to look into using that.