Getting the volume serial number of a disk.
Kernel 2.6.21.5, Slackware 12.0
Hi: Code:
root@darkstar:~# blkid Code:
root@darkstar:~# vol_id /dev/hdc But for the optical disks (iso9660) it gives them not. Neither does the second one. This number is known as 'Volume serial number' in MS-DOS, and is printed on console with the command 'dir' not only for the HDD partitions but for the optical disks too. The question is: how to get an optical disk Volume serial number? Notice that this number is inherent to the media (is a property of the media, under any O.S.). Any hint will be welcome. |
Does this thread help?
http://www.linuxquestions.org/questi...11-2-a-819367/ |
Thanks for your post. I've read your link through but I'm afraid you did not quite understand. The command hdparm -i <device> gives you the drive serial number. Instead, every partition on a hard drive has a unique UUID. For the case of vfat, this UUID is of the form MMMM-NNNN, say 5A4B-32A0 and is a part of the Bios Parameter Block.
Now, CD-ROMs also have a number of the form MMMM-NNNN. I'll skim the Orange Book specification to see how to read it by program, but shame on Linux if it has not the adequate tool. Regards. |
then I am sorry for taking your thread off the zero reply list, hope this gives it a bump.
|
Quote:
http://www.linuxquestions.org/questi...ubuntu-714693/ |
Yes, but for the case of a CD-R, either it's set by the manufacturer or by the authoring tool used. Under MS-DOS, if I do 'dir H:', where H: is the optical drive and this drive contains an audio CD (CDDA) then the said serial number is displayed. That is, even Red Book CDs have this serial number. Thanks for your reply.
|
UUID is not the device/media serial number. It is a filesystem specific identifier.
For brain-dead filesystems (like [v]fat), they are generated by your Linux system. |
Quote:
I just told you that the Volume ID reported by DOS/Windows is a derived number from a time stamp on the disk when it was created. This VOL ID number is NOT stored on the disk it is made by DOS/Windows and the code to generate the number is available from Microsoft. You will not find the VOL ID anywhere on an optical disk no matter how hard you look, it just does not exist outside of DOS/Windows. |
Of course you're speaking about optical disks, I'll assume. However, the SFF Committee document INF-8090 Rev 6.1 (Feb 8, 2006) speaks about a media serial number. Unfortunately, it refers to MMC. Regards.
|
Quote from wiki article:
Quote:
|
have a look at lshw. This is what I use. I write it to xml and then display nicely in my program. You get all the hardware info along with the disk serials and volume serials. http://ezix.org/project/wiki/HardwareLiSter
here is a snippet from lshw output on my system (just showing a disk). Notice the serial for each volume and the disk serials Code:
<node id="disk" claimed="true" class="disk" handle="SCSI:00:00:00:00"> |
Thank you for your post, jcas1411. I have downloaded and run lshw but the serial numbers are nowhere to be seen. The syntax I used is this:
Code:
$ lshw |
I just did sdparm -i /dev/sda for mine.
|
The command I use is lshw -xml. Nothing special but it does show the serial of hard disks and volumes on those disks. Be sure to send this to a file lshw -xml > ~/Desktop/harware.txt or pipe it to less as it may run past the buffer limit on the terminal. If you running this in a vmware world looking at a virtual disk you will only get a volume serial because virtual disks do not have serials. I ran on my physical computer and it does show as above, serial for hard disk, and volume serials.
I dont think it will show serials of optical disks, is that what you are wanting? John |
serial number of the optical drive itself can be found with
hdparm -I /dev/sr0 if sr0 is your optical drive. this does not help with the volume (a mounted cd) |
All times are GMT -5. The time now is 03:09 AM. |