[clug] Unique Id's and CD's

Andrew Janke a.janke at gmail.com
Thu May 7 03:23:55 GMT 2009

2009/5/7 Brett Worth <brett at worth.id.au>:
> Jack Kelly wrote:
>> /dev/cdrom | sha1sum ?
> Of course that assumes that /dev/cdrom is executable.  Which it probably isn't.  Maybe you
> meant:
>    sha1sum < /dev/cdrom
> Or:
>    cat /dev/cdrom | sha1sum
> The down side of these methods is that to determine the unique ID of the cdrom requires a
> full read which takes a while.  It'd be nicer if the unique id was perhaps written into
> the cd label at burn time.  Depends on whether the requirement is for new cds or for all cds.

Thanks all for the pointers,  I have decided to go with:

   du -ak /media/cdrom0/ | sort -k 2 | sha1sum

So that I am combining file names and sizes. Should be sufficient. The
sort is in there as I am not all that sure that du will always return
the same thing for a disk that has been burnt with all the same files
but in a different order. (duplicate CD's are a real possibility).

Andrew Janke
(a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia    +61 (402) 700 883

More information about the linux mailing list