Afficher un message
Vieux 24/03/2008, 20h17   #3
pk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: testing files for read errors by copying to /dev/null

Charles Russell wrote:

> I would like to test the integrity of a CD (after burning from .iso) by
> reading all its files and looking for error messages. (I'm using Cygwin,
> so I cannot access the CD drive as a dev/, only as a mounted filesystem.)
>
> If I try
> cp -rv /cygdrive/d/* /dev/null
> then I get a message that /dev/null is not a file or directory
>
> If I try
> tar -cvf /dev/null /cygdrive/d
> then the command runs so fast it cannot possibly be reading the whole CD.
>
> If I try
> find /cygdrive/d -type f -name '*' -print -exec cat {} >/dev/null \;
> then the disk drive seems active for a reasonable length of time, but
> despite the -print flag, I get no output to confirm what is actually
> happening. I expected the filename to be printed before each file was
> read.
>
> What is the best way to do what I am attempting?


The best way to check burned CDs is to calculate a hash on the medium and
compare it with the hash of the original .iso file. If the medium is
mounted, this is not possible (you can do mkisofs | md5sum on the directory
where you mounted the medium, but the results will almost certainly be
different even if the CD has no errors).

If you are content with just trying to read all files on the cd and see
whether any error is reported (a method far from reliable), then something
like (on a single line)

find /path/to/mnt -type f -print -exec sh -c 'cat "$1"
> /dev/null' '{}' '{}' \;


should kind of work.

--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
  Réponse avec citation
 
Page generated in 0,05266 seconds with 9 queries