[conspire] PING (Partimage Is Not Ghost) -- Backup and Restore Disk Partitions
daniel at gimpelevich.san-francisco.ca.us
Fri Feb 22 16:03:27 PST 2008
On Fri, 22 Feb 2008 14:45:30 -0800, Rick Moen wrote:
> Quoting David Fox (dfox94085 at gmail.com):
>> I know Bruce has been doing some partition saving and restoring lately
>> on his various laptops. Me, I've not gone that route - the few times in
>> the past when I needed (or wanted) to have partitions moved elsewhere
>> (for instance, /home on hda1 instead of somewhere else) I made sure I
>> had a place that was big enough to hold the whole partition, and then
>> I'd do something like;
>> cd dir; tar cvf - | (cd /mnt/somewhere; tar xf -)
> Yes, I agree with you, that your general method (file-by-file copying) is
> almost always what one _really_ should do, and that, by contrast, making a
> binary image of a filesystem is almost always solving the wrong problem.
The question to ask here is "Is it the files I want safe, or some
arbitrary filesystem metadata which may include those files?" The question
of how to back stuff up for restoration somewhere else comes up quite
frequently at CABAL, and I typically always say to use tar.
> I have a feeling that the prevalence of Symantec Ghost among members of
> the computing public has conditioned people to tend towards solving the
> wrong problem, in such situations.
Utilities like Ghost usually do not use bit-for-bit copies of whole
filesystems, but rather their own tar-like formats with additions for boot
sectors and other whole-filesystem elements tacked on. So, regardless of
what problem one thinks one needs to solve, the solution often ends up
being pretty much the same.
> You might consider:
> $ ( cd dir && tar Scpf - . ) | ( cd /mnt/somewhere && tar Sxvpf - )
> The "&&" is because you really don't _want_ the tar command to proceed
> unless the related "cd" works. The "S" means handle sparse files
> efficiently. "p" is preserve permissions. "v" is verbose reporting.
This is a shorter synonym:
tar Scp -C dir . | tar Sxvp -C /mnt/somewhere
> If copying files across an ssh tunnel, you might want to also add "z"
> (gzip compression) on both sides.
> $ ( sleep 10; cd dir && tar Sczpf - . ) | ssh username at newhost 'cd
> /mnt/somewhere && tar Sxvzpf -'
Using "j" instead of "z" gives bzip2 instead of gzip:
tar Scjp -C dir . | ssh username at newhost 'tar Sxvjp -C /mnt/somewhere'
More information about the conspire