Re: volume serial number + volume label



From: andrew clarke <mail@xxxxxxxxxxxx>

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@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: volume serial number + volume label
    ... "volume label" of a removable disc in FreeBSD? ... This is the same information that's presented by issuing a "dir" command in Windows: ...
    (freebsd-hackers)
  • Re: Myaskovsky String Quartets
    ... issuing the Svetlanov cycle on individual CDs? ... IF some label will reissue the whole set, it should be Warner, that has bought ...
    (rec.music.classical.recordings)