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.

I'm looking for a fast and reliable way to move some chosen directories from one HDD to another.

The case is as follows. I'm getting a new desktop system which will replace my old desktop. I want to migrate a couple of directories from the old system to the new system and I'm quite concerned about the integrity of the data. The amount of data I want to migrate is >300 GB. This might take a while to move even over 1000 Mbit/s Ethernet, so I figure the fastest way is to unplug the HDD of the old desktop (it's connected via SATA) and plug it into the new system and cp the data to the new system's HDD.

My question: Is this the best and most reliable way to proceed? If not, how should I proceed? Maybe I'm better off using rsync? I would also want to know how any solution handles permissions and how it preserves the integrity of the data.

share|improve this question
    
Related serverfault.com/questions/47707/… –  N.N. Jul 5 '11 at 22:25
add comment

1 Answer 1

up vote 2 down vote accepted

I'd personally trust rsync to do the job (with -arvx flags - archive, recursive, verbose and one-filesystem) but if you need something extra:

sha256sum <(find ./original_path/ -type f -exec sha256sum {} \; | sort) | cut -d' ' -f1
# Should output something like:
# dbda116eaa459cee10b25765202c37d40b9371df52afb2ad202b13327760b251

# copy your files to ./new_path/
# Something like: rsync -arvx ./original_path/ ./new_path/

sha256sum <(find ./new_path/ -type f -exec sha256sum {} \; | sort) | cut -d' ' -f1
# Should also output:
# dbda116eaa459cee10b25765202c37d40b9371df52afb2ad202b13327760b251

If you're not happy with rsync, you could always tar up the files and extract them in the new location. I'd recommend checking their integrity with a similar method as above, if they're really important.

share|improve this answer
    
Man page says "archive mode; equals -rlptgoD (no -H,-A,-X)". That would make -avx sufficient flags? –  N.N. Jul 15 '11 at 17:07
add comment

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.