LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-26-2009, 05:22 PM   #1
brianpbarnes
Member
 
Registered: Dec 2005
Posts: 143

Rep: Reputation: 15
DVD "Volume Serial Number" in Suse or Ubuntu?


Hi,
I am trying to index a large pile of DVDs I have burned over the years, mostly with JPG images. In DOS, when you do a `dir`, you get an 8 hex digit "Volume Serial Number" which is burned into the ROM and appears to be unique (possibly a date created hash):
c:\> dir e: <enter>
Volume in drive E is 20080601a
Volume Serial Number is F15F-12C4
<snip>

I have never been able to find this in any Linux command, but all the DVDs burn in Linux have it because I can see it in windoz.

Thank you,

BrianP
 
Old 03-26-2009, 05:51 PM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
See k3b --> media info
 
Old 03-26-2009, 06:46 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
Try looking at it using udevinfo. "udevinfo -q env -n /dev/sr0". I think there is a more direct way, but I don't remember the command. It looks like the Volume Serial Number is the same as the "FS_UUID" number that udevinfo returns for filesystems.
 
Old 03-26-2009, 06:55 PM   #4
brianpbarnes
Member
 
Registered: Dec 2005
Posts: 143

Original Poster
Rep: Reputation: 15
Amani,
What is media info? There appears to be no such Ubuntu command. K3B looks like a GUI front end for burning? I need some kind of command line whose output I can parse.

The only *media* command on Ubu 8.10 is /usr/bin/dvd+rw-mediainfo. It details write speeds, dvd structure, track info, fabricated toc, ..., but no volume serial number or even volume label. :-(

I have tried hwinfo --cdrom, lshw -C disk, grep cd /etc/mtab, ...

The Volume Serial Number appears to be some type of social security number hash unique to each disk and in want to use it as an index on an SQL table.

Thank you,

BrianP
 
Old 03-27-2009, 01:10 AM   #5
brianpbarnes
Member
 
Registered: Dec 2005
Posts: 143

Original Poster
Rep: Reputation: 15
udevinfo gives a DVD Volume Label but no UUID or Volume Serial Number.

Jschiwal,
This gives me a good, additional solution to another nagging data extraction problem, finding a reliable way to get the Volume Label. For some strange reason, neither lshw nor hwinfo consistently gives me the volume label I assigned when I burned the ROM. Nautilus shows it, but I can't figure out how it does it!

brianp@godzilla:/# udevinfo -q env -n /dev/sr3 | grep ID_FS_LABEL= | psr.pl s/^.*=//
20090116a [Eureka!]

On my BluRay burner, I often get /media/cdrom0 from lshw instead of something like /media/20090127a. I then have to fall back on hwinfo to get Volume ID: "20090127a". But on some of my disks, neither one works. Without being able to detect this programmatically, I have to:
1) eject the DVD
2) stuff it in a windoz box
3) execute `dir e:` to discover the label
4) copy it from a DOS window
5) vi a new file
6) paste it into the new file
7) save it to a Samba shared drive
8) open it in Linux
9) copy the VSN
10) paste it onto the dvd_read.pl -v $VSN command line to hotwire it

Aye Carumba! I believe the technical term for such a kludge is ICKY!

Hwinfo never detects a VL on my 2 dvd readers attached to a PCI, dual PATA card I installed to access more than 2 DVD readers. With 4 cores, I can keep 4 DVD digestion sessions going simultaneously, with MD5 signature calculations.

But alas, in all cases I have tried, I get "ID_FS_UUID=" with no Volume Serial Number. Some Linux architects must be chagrined to discover that the lowly DOS dir command can easily extract more data from a DVD than the refulgent heir to the throne. ;-)

The reason I wanted to use the Volume Serial Number as a primary key is that it is consistently calculated by the burning software at burn time [1] and does not rely upon my dim-witted burnmaster (me) to remember to type in a meaningful Volume Label at burn time.

Obviously, Linux does provide some way to extract these 8 critical characters of data from a DVD, but how?

Thank you,

BrianP


Ref[1]: From http://en.wikipedia.org/wiki/Volume_serial_number
The serial number is a 32-bit number determined by the date on the current computer[2] at the time of a disk's formatting
 
Old 03-27-2009, 04:38 AM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
You can also find it by browsing through the output of:

Code:
head -n 10 /dev/cdrom | strings -n 10

# or

head -n 10 /dev/cdrom | hexdump -C

# or

head -n 10 /dev/cdrom | most

Last edited by H_TeXMeX_H; 03-27-2009 at 04:41 AM.
 
Old 03-27-2009, 09:17 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
Which backend burning program does Ubuntu use? Look at the contents of the package. IIRC, wodim which tends to be used now supplies several utility programs, and one of them may return the disc info you need.
 
Old 03-27-2009, 11:30 AM   #8
brianpbarnes
Member
 
Registered: Dec 2005
Posts: 143

Original Poster
Rep: Reputation: 15
Test case for brute force hacking DVD Volume Serial Number.

H_TeXMeX_H,
There is some pretty interesting info here and maybe even an encrypted version of the Volume Serial Number. Here is my test case:

DOS:
Volume in drive E is 20090127a
Volume Serial Number is 7D8B-C1C3

Ubu:
root@godzilla:/home/brianp# head -n 10 /dev/sr1 | strings -n 10 | freq.pl -wc
3 *OSTA
2 *UDF
10 *genisoimage
2 0000000000000000
6 2009012713304400
1 20090127a
2 497F60E4000222E0
1 Brasero-0.8.2
3 Compliant
10 Compressed
2 Info
1 LINUX
2 LV
10 OSTA
3 UDF
10 Unicode

I am wondering what this token is: 497F60E4000222E0. The time/date stamp too is listed 6 times. Isn't this what is used as fodder for the hash algorithm? I tried simply converting the 7D8BC1C3 to decimal and got something in the 2 billion range so it's not a Unix date (leading digit 7, duh .

I also dumped the hex to a file and grepped for the 7d8b in case insensitive mode and found nothing. I tried putting spaces in between the digits too. No luck.

Perhaps, it is not stored verbatim, but rather hashed out at `dir` time. I tried Googling it, but am apparently chasing my own tail and finding my own, previous posts.

Any ideas on which hash algorithm might be used.

I would hate to have to reboot to xp to get this data. It would seriously fork up my forking programs.

==================================================================

Jschiwal,
Ubuntu does not have packages for debianburn, cdrtools, cdrecord, or cdrkit. The Brasero command line api contains only data out commands like open, copy, empty, ... It's a burner, not a reader.

Wodim pointed me to cdrkit.org. Similar to Brasero only much more hard core. Without a package, I would not even begin to try to build it here. The documentation pointed to a /usr/local/bin/cd-read command which is very low level.



Thank you,

BrianP
 
Old 03-27-2009, 12:02 PM   #9
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
#head -n 10 /dev/dvdrw | strings -n 10

On CAELinux Live dvd


LINUX
20080410
http://livecd.berlios.de/
mklivecd 0.6.0-20071202 PCLinuxOS release (PCLinuxOS) for LiveCD 2008041012353600
2008041012353600
0000000000000000
2008041012353600
ISO MD5SUM = 959eefe74b130f8bda32ba7b16901b2d
THIS IS NOT THE SAME AS RUNNING MD5SUM ON THIS ISO!
EL TORITO SPECIFICATION
2008041012353600
2008041012353600
0000000000000000
2008041012353600
________________________________


Where exactly is the Volume Serial No located? in the alternative file system descriptor area?

Last edited by amani; 03-27-2009 at 12:03 PM.
 
Old 03-27-2009, 02:16 PM   #10
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,844
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Quote:
1) eject the DVD
2) stuff it in a windoz box
3) execute `dir e:` to discover the label
4) copy it from a DOS window
5) vi a new file
6) paste it into the new file
7) save it to a Samba shared drive
8) open it in Linux
9) copy the VSN
10) paste it onto the dvd_read.pl -v $VSN command line to hotwire it
Not that it's a solution,but you could use dosbox or dosemu, write a macro in autoexec.bat to write the output of "dir" to file and skip steps 1-9.
 
Old 03-27-2009, 02:34 PM   #11
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Here's what I get for one of the disks I burned:

Code:
                                                               2009021917360200
2009021917360200
0000000000000000
2009021917360200
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
MKI Thu Feb 19 17:36:02 2009
So 2009021917360200 means 2009 02 (Feb) 19 17:36:02.00

As for the volume serial number, don't bother, because you won't find it on the disk, it is computed internally by DOS / Window$. I'm not sure as to the algorithm, but you may find something here or search google:

https://www.osronline.com/cf.cfm?Pag...FM?link=134085
http://www.reactos.org/generated/dox...8c-source.html
 
Old 03-27-2009, 04:59 PM   #12
brianpbarnes
Member
 
Registered: Dec 2005
Posts: 143

Original Poster
Rep: Reputation: 15
The optimal solution at last!

H_TeXMeX_H, Mostlyharmless, Amani & Jschiwal,
Attempting to recreate uncle bill's dos madness in Linux is itself insanity, not to mention borderline blasphemy. I now see the error of my ways. Having a human readable disk format date/time stamp down to the hundredth of a second is vastly superior to some funky, encrypted, ms date hash anyway.

Here's the bottom line:
root@godzilla:/home/brianp# head -n 10 /dev/sr1 | strings -n 10 | freq.pl -wu | gr.pl '^[12]\d{8,}$'
2009012713304400

I can also add an error check on my written label which is supposed to be of the form 20090127a. Just make sure that the numerical part of the volume label can be found in this format date specification. Some have a Volume Label like "NEW" (yikes). I can hotwire these few in by hand.

I am finally going to get this mountain of old DVDs under control!!!

Muchas Gracias,

BrianP
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Gnome, Shortcut for "headphones" instead of "volume" Bollie Linux - General 2 06-07-2007 09:19 PM
SuSE 10.1 DVD Upgrading 10.0 "no Valid Installation Media" Riddick SUSE / openSUSE 2 06-12-2006 04:11 PM
NEC DVD-RW ND-3540A "blocked" in SuSE Linux 9.3 Jbw1291 Linux - Hardware 6 02-06-2006 06:54 AM
Where "install me" for suse live dvd? harzfled SUSE / openSUSE 3 04-17-2005 04:13 AM
SuSE 9.2 DVD ISO install "Cannot read package data from installation media" problem BEaton SUSE / openSUSE 3 04-08-2005 01:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration