[clug] Unique Id's and CD's

Robert Edwards bob at cs.anu.edu.au
Thu May 7 04:12:06 GMT 2009


Andrew Janke wrote:
> 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

Of course, none of these solutions guarantee a "unique" id.
Depends upon how "unique" you want your ID to be... (ie. in
what domain the uniqueness needs to hold).

Cheers,

Bob Edwards.


More information about the linux mailing list