[mdlug] Network backup options
David Favro
mdlug at meta-dynamic.com
Sun Feb 4 00:01:42 EST 2007
R. Kannan wrote:
>> Or if you want to copy the entire partition gzipped:
>>
>> gzip /dev/hda1 | ssh user at laptop "cat > ~/desktop.hda1.gz"
>>
Maybe just an oversight on your part (or my part?), but I would advise
adding "--stdout" to the gzip command. Without it, gzip normally tries
to replace the file being compressed. When I saw this I thought maybe
there is some special fluke where --stdout is assumed for device files,
so I read TFM and I'd have to say that at best, you're relying on some
undocumented behavior that may change in the future. So:
gzip --stdout /dev/hda1 | ssh user at laptop "cat > ~/desktop.hda1.gz"
Or, if you want to execute it on the laptop:
ssh user at desktop gzip --stdout /dev/hda1 > ~/desktop.hda1.gz
If the partition is lightly populated, one is typically better off to tar the directory tree rather than dump the raw device, to avoid archiving lots of unused device blocks (also makes it easier to restore to partitions of different sizes, only restore a portion of the directory tree, etc.).
There are many other issues here, however. I assume that your partition is encrypted, as most data partitions should be (how are you going to dispose of that HDD?). If you choose to tar up the directory tree, you are archiving cleartext, so you must re-encrypt your data using a tool such as gpg (you aren't going to archive cleartext, are you?). Gpg contains built-in compression, so you won't need the gzip from the above command. The above command also assumes that there is enough free space on the laptop's filesystem to hold the entire desktop's (compressed) partition.
Then there is also the issue as to how [best] to get the data onto DVDs (I assume that the size of some partitions exceeds the size of a single DVD). Short of waiting for some kind of Blue-Ray burner... I have in the past used a tool called 'shunt' which aids in spanning a single archive across multiple removable-media units, especially if you don't/can't store the whole archive image to disk before offlining; but it leaves much to be desired.
I would be interested in hearing list-members' opinions on how best to make an archive that spans multiple removable media (with only one burner/reader). There are many desirable attributes -- among others, one is that, to retrieve a file on, e.g., the fourth of six DVDs, I shouldn't have to insert and scan through the first three DVDs, but just go straight to the fourth (maybe after inserting the first or sixth to read a directory map).
More information about the mdlug
mailing list