[Discuss] Multiple HDD setup in Linux

Ken Murray kmurray at gmail.com
Sat May 10 01:16:58 PDT 2008


On Tue, May 6, 2008 at 10:00 PM, Alan W. Irwin
<irwin at beluga.phys.uvic.ca> wrote:

>  To check for i/o errors or other problems with such a copy I would
> calculate
>  an md5sum for every file on your old disk as follows:
>
>  find . -type f >| files.list
>  cat files.list |xargs md5sum >| md5sum.out
>
>  Then use that md5sum.out file to check the copied files on your new disk
>  using "md5sum -c md5sum.out" in the appropriate directory.

Just today I found myself needing something like this.  Unfortunately
I ran into problems due to some of the file and directory names
containing spaces and other non alphanumeric characters which confused
md5sum.

Here's what worked for me:

find . -type f >| files.list
sed 's/^/"/' files.list | sed 's/$/"/' > files.list.quoted
cat files.list.quoted |xargs md5sum >| md5sum.out

Then run "md5sum --status -c md5sum.out" in the target directory.

The sed command puts quotation marks around all the file names and the
--status flag to md5sum tells it not to output anything other than
wether it was successful or not.


-- 
Ken

echo 16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlb xq |dc


More information about the Discuss mailing list