[PATCH] read drive serial number

David Zeuthen david at fubar.dk
Sun Aug 1 17:55:47 PDT 2004


On Mon, 2004-08-02 at 01:44 +0200, David Zeuthen wrote:
> In other words, is it feasible to format, say, a USB thumbdrive with a
> FAT filesystem on the main block device, e.g. /dev/sda? Or is it after
> all, a (constant) property of the drive? I think it is not.

I just tried this, I can indeed format my USB drive to have a msdos
filesystem at /dev/sda and happily mount it /dev/sda (not that mkfs(8)
was particular helpful, but there are tricks). Now to teach HAL to do
the same :-)

>  Perhaps,
> maybe, one solution is to simply see if the main block device got a
> valid partition table? In fact, the kernel knows this, it reads the
> partition tables; it should export it through sysfs.

It might be easier to put in some partition table detect code ourselves
in HAL - would be more portable as well. 

In fact what we need is just the "negative filter", e.g. being able to
say this raw disk doesn't appear to have any known partition schemes
(within reasonable definitions of known), rather than fully identifying
every detail with a given partitioning scheme (cause if the disk is
already partitioned the kernel will need to deal with this anyway). 

Btw, here is an interesting page

 http://disktype.sourceforge.net/

Good night,
David

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list