Re: volume serial number + volume label
- From: Sergey Babkin <babkin@xxxxxxxxxxx>
- Date: Thu, 23 Feb 2006 06:40:41 -0600 (CST)
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"
- Prev by Date: Re: (feature change request) remove link-layer generated routes from netstat -r
- Next by Date: usb2 iscochronous transfer
- Previous by thread: Re: volume serial number + volume label
- Next by thread: Saving register values
- Index(es):
Relevant Pages
|
|