Volume id

Laszlo Nagy gandalf at shopzeus.com
Thu Nov 15 12:19:10 CET 2007

Gabor Urban wrote:
> Hi,
> I have a problem, which may be trivial, but I could not find an answer.
> I have to write a Python script, which does a directory tree walking 
> on given mounted disk. But I do need to extract the volume id, 
> somehow. And that's the problem.  An additional issue, the script will 
> be used on unix type systems, and on MS XP or Vista, too....
> Any ideas are wellcome.
I believe (although not 100% sure) that "volume id" always belongs to a 
FAT partition (maybe an NTFS partition?). When you format a partition, 
it will give you a - hopefully unique - volume identifier. I don't think 
that unix partitions (like reiserfs, ext2, ext3, ufs2 etc.) has that 
identifier. I may be wrong, others will probably correct me.

Do you want to know the identifier (serial number?) of the disk device 
instead? E.g. not the partition but the hard disk?

Can you list the platforms/operating systems where you want to use your 
program? It might help to look at the documentation/source code or the 
various hardware diagnostic utilities.



More information about the Python-list mailing list