[H-GEN] Transferring a RH Linux system from one drive to another

Jason Henry Parker henry at freezer.humbug.org.au
Tue Jan 12 00:11:58 EST 1999


On Tue, Jan 12, 1999 at 02:46:15PM +1000, Anthony Towns wrote:
> On Tue, Jan 12, 1999 at 02:30:42PM +1000, Campbell wrote:
> If you the other drive is the secondary drive (ie, not / or /usr or anything
> important) in another machine, and you have ssh (or rsh) setup properly and
> a LAN between the two, you can do something like:
> 
> 	old.machine# ssh root at new.machine
> 	new.machine# mount /dev/new /mnt
> 	new.machine# exit
> 	old.machine# tar czf - / | ssh new.machine tar -C /mnt xzpvf -
> 
> You'll need to be careful that you've got ssh setup properly first though --
> trying a few test tar | ssh untar's would be a good move.

I've given this advice a few times before, but I'll repeat it now just
in case.  When using tar to copy filesystems like this, be aware that
GNU tar[1] does *NOT* chmod and chown the created files on the remote
end until *AFTER* the tarball has completely finished unpacking.

I can remember running a tar like this of several hundred or perhaps
thousand user accounts late one evening, and thinking "Oh, I'll just
check tht tar is doing what I think it is before I really leave."
Imagine my horror when I found that all the files were owned root.root
with a default umask!  I spent literally hours fiddling with tar at both
ends before deciding to test it on a *single* home directory[2], whereupon
I found it worked perfectly, just not in the order I thought it did.  :)

Alternatively, (and you all *knew* I was going to say this) you could
just use rsync[3][4].  Saves all that messing about with permissions
and pipes and such rot.

HTH someone.

Jason Henry Parker

[1] : And what other tar *would* you use?[3]

[2] : It was late.  Very late.

[3] : I'm beginning to think that unless you're distributing sources
      or binaries across the net in a form everyone can use, tar is
      just The Wrong Solution.  Dump and restore do better backups.
      Rsync does better cloning.

[4] : http://rsync.samba.org/ for a rundown on rsync, and the (small)
      source code.  http://fox.uq.net.au/~zzjparke/rsync.html for a basic
      rundown on how it works, what it's good for, and some explanation
      of options.

-- 
| ``Seargent Colon had had a broad education.  He'd been to the school |
| of My Dad Always Said, the College of It Stands To Reason, and was   |
| now a post-graduate student at the University of What Some Bloke In  |
| The Pub Told Me.'' -- Terry Pratchett, /Jingo/     NetHack:  C V P T |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 366 bytes
Desc: not available
URL: <http://lists.humbug.org.au/pipermail/general/attachments/19990112/626801c1/attachment.sig>


More information about the General mailing list