LWN.net Logo

insmod sbd.ko error ??

insmod sbd.ko error ??

Posted Nov 3, 2007 0:39 UTC (Sat) by rbartlett (guest, #48846)
In reply to: insmod sbd.ko error ?? by midhun001
Parent article: A simple block driver

The "sbd0: unknown partition table" is normal.  The allocated memory is uninitialized when the
module is first loaded so it can't contain a valid partition table.  You can either use sfdisk
or mkfs to create a partition table or file system in the allocated memory.  If mkfs is used,
the driver may subsequently be mounted.

I had to make a few minor changes to the driver to get it to this point.  I had to add the
following line to the sbd_ops structure:
".getgeo = sbd_blk_getgeo"
Then I had to create a function sbd_blk_getgeo with the code from the HDIO_GETGEO case from
the sbd_ioctl function.  This was because sfdisk complained that "Disk /dev/sbd0: cannot get
geometry".

The last thing I had to do was change "geo.start = 4" to geo.start = 0".  This was because
sfdisk complained that "Warning: start=4 - this looks like a partition rather than the entire
disk. Using fdisk on it is probably meaningless."

Once these changes were made, I was able to use sfdisk and mkfs on the device and mount it as
well.


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.