Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After I copy say 50+ GB(30,000 files including different formats) of files from an internal hard drive to an external drive is there any way to find out if everything has been copied correctly? Also if I stop in between by canceling the operation and later say merge when continuing the operation will the correctness take a hit?

I could use applications like back-in-time but I am very choosy in copying files and for the next time I intend to use copy operation and say merge instead of replace. Is it advisable when copying large number of files?

share|improve this question
2  
you may find an answer here. –  Takkat Apr 28 '11 at 10:15

4 Answers 4

up vote 7 down vote accepted

I'm using hashdeep to verify backups/restores and occasionally to check for file system corruption in a RAID.

The speed depends on which hash functions you use (some are more CPU intensive than others) as well as the read speed of your disks. On my system hashdeep can process or verify around 1 TB/hour with md5 and 300 MB/s read speed.


Example on calculating checksums and storing them in a file:

$ cd my-data
$ hashdeep -rlc md5 * > ~/checksums.txt

Parameters:

  • r - recursive
  • l - use relative paths
  • c - specify hash function
  • * - apply to all files in current directory
  • > - redirect output to the specified file

See the man page.


Example on verifying checksums and printing a list of differences:

$ cd /mnt/my-backup
$ hashdeep -ravvl -k ~/checksums.txt *
hashdeep: Audit passed
          Files matched: 40914
Files paritally matched: 0
            Files moved: 0
        New files found: 0
  Known files not found: 0

Parameters:

  • a - audit (compare with the list of known checksums)
  • v - verbose (to get a listing of mismatches, multiple v's means more verbose)
  • k - file of known hashes
share|improve this answer

It looks like the perfect task for rsync. Rsync is comparing and copying diffs.

share|improve this answer
1  
rsync is definitely the tool for this job, but it doesn't compare and copy diffs, per se. It compares the files using sizes and hashes. –  sidewaysmilk Apr 28 '11 at 19:18

If the GUI apps suggested over at File and directory comparison tool? don't do it for you, try diff -rq /path/to/one /path/to/other to recurse through both directories quietly, logging only differences to the screen.

share|improve this answer

The situation you are saying is too complex. Though you can write a script to calculate MD5 of all the files you want to copy and later on compare them with the ones copied:

If you want simple and fast thing (though it will not work in very very complex scenarios) you can use Meldinstall meld

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.