0
1
I have two Linux notebooks on a network and no additional storage. I want to backup the first notebook hard drive (make full HDD image), on the second notebook. How could I do that using real-time compression?
0
1
I have two Linux notebooks on a network and no additional storage. I want to backup the first notebook hard drive (make full HDD image), on the second notebook. How could I do that using real-time compression?
2
To make hdd partition copy which will be workable and locally mountable you need to act as following:
Execute following:
$ dd if=/dev/sda2 conv=fdatasync bs=8096 | gzip -cf > $PATH_IN_EXTERNAL_FS/sda2.img.gz
$ dd if=/dev/sda2 bs=8096 | md5sum - > $PATH_IN_EXTERNAL_FS/sda2.orig.md5
Note: You may execute those two in parallel;
Note: This can take a LONG time (f.e. on wireless (G) connection it took 34 hours to process 150 gb NTFS image, and image was gzipped to 106 gb and md5 sum counting for it took about an hour); Note: You can observe dd's progress by executing following in another terminal window:
$ watch -n30 "kill -USR1 $PID_OF_DD"
When it will be finished on the other computer (where image is now stored) execute following:
$ gunzip -c sda2.img.gz | dd of=sda2.img bs=8096 && dd if=sda2.img bs=8096 | md5sum - > sda2.img.md5
Now compare original partition's and image's md5 sums:
$ cat sda2.orig.md5 && cat sda2.img.md5
Note: If strings are equal everything is fine;
Now you can mount sda2.img as you'd do with original partition but you must specify loop option to mount tool. Following should work:
# mount -o loop sda2.img /mnt/sda2_img
Note: maybe you'll need to specify some other mount tool options to make it work;
Can you add a couple of sentences to your answer to explain the loop option mentioned at the end (what is it, how do you add it to the mount tool)? – fixer1234 – 2014-12-24T17:10:36.587
@fixer1234 done! – fifajan – 2014-12-25T07:11:27.673