>From: andrew clarke <[EMAIL PROTECTED]>
>
>How can I programmatically retrieve the "volume serial number" and
>"volume label" of a removable disc in FreeBSD?  This is the same
>information that's presented by issuing a "dir" command in Windows:
>
> Volume in drive D is FooBar
> Volume Serial Number is 58BB-96AA

I've been reading on the Windows filesystems recently,
so here is the quick answer:

The serial number is contained in DOS/Windows
partition's boot block, 8 bytes at offset 0x48.

For the label you have to parse the DOS/Windows
filseystem format. On FAT it's the name of the file
in the root directory with the special attribute
(VOL or LABEL - something like this, can't remember 
now). On NTFS it's stored I think as the attribute
$VOLUME_NAME of the system file $Volume contained in the
inode 3 of the Master File Table.

-SB
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to