Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disk Cloning with "dd" and "rsync"
#1
I just got back from a Linux class and one of the tools that I learned about was a command called "dd" for "data dump" I think. It makes a byte-wise dump of an entire drive partition, directory, or file. To test it on my laptop, I booted an Ubunu live CD and made an copy of my Ubuntu partition on the laptop and copied it to an external USB drive. The command is:

sudo dd if=/dev/hda2 of=/dev/sda2

This will copy the second partition of my laptop drive to the second partion of my external drive. It works for any partition, any file format, as it is a byte-by-byte copy from one to the other. This works fine, except that you need to have the machine or drive unmounted so that the data is not in use while it is being copied. The 'if' and 'of' stand for "input file" and "output file".

Next I'm going to play with rsync. rsync will mirror directories accross a network to a different computer. When copying data, rsync compares the source and target directory and transfers only data that has changed or been created since the last rsync process. In theory, you could create a "ring" of friends and use each others computers as off-site storage for important data.

This stuff is probably old news to the linux and unix gurus, but it is exciting for me. I've been trying to figure out how to make an image of my Asterisk PBX for about 10 months and no one could/would explain it to me. I think that I may finally have a solution.
Reply
#2
man ditto
Reply
#3
Thanks, I'll check that out too.
Reply
#4
you might like to google dd_rescue, http://www.google.com/search?num=100&hl=en&lr=&safe=off&q=dd_rescue&btnG=Search
Reply
#5
i've used ditto in the Terminal to backup customer files when the FInder quits on a corrupt file. ditto just plows thru until it's done - bad files don't copy, good ones do.
Reply
#6
[quote elmo3]man ditto
ditto
Reply
#7
6 years later... what was the end result of your experiments. I'm working on a project and I'm doing research on whether the two programs play well together. Final thoughts ztirffritz?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)