gabriel rosenkoetter on Fri, 10 Nov 2000 16:36:39 -0500 (EST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Moving /usr to a new partition properly


On Fri, Nov 10, 2000 at 04:17:26PM -0500, Michael Leone wrote:
> >   # cd /usr
> >   # tar cfp - . | ( cd /mnt/new_part ; tar xpf - )
> 
> If I want to save a copy (as you suggest later on), why do the tar this way,
> instead of tarring to a file? And then untarring the file? I realize this
> saves a step, but at the expense of security, doesn't it?

Because this is faster, and it's better to preserve the old just as
you say below. (Oh yeah, this is worlds faster than cp too, btw, and
much kinder to your disk, as I recall... that may or may not be true
in ext2fs, though; wouldn't know, haven't used it much.)

Also, because tar'ing and untar'ing into a file leaves the chance
that you don't put yourself at exactly the right point, and you get
a wack directory structure out. (Granted, that's user error, but the
tar line above is complicated enough that you'll think twice before
you hit return. tar cf <foo.tar> <foo> ; cd <bar> ; tar xpf
<path/to/foo.tar> isn't so much.)

> Well, that's why I was just going to rename /usr to /old_usr - to keep a
> copy around.

Sure, if you've got space around. When I first did this on a NetBSD
1.2ish machine, I was adding a 500 MB drive for /usr to relieve the
lonely 230 MB drive that contained /, and my memory for the process
stems from that. I didn't want to keep *anything* around, even for a
couple of days, "just to make sure", but I contented myself with a
tarball. (... and trashed that pretty promptly.)

(Incidentally, that tar command is the ideal way to move user's home
directories around too. cp *really* borks that one up, especially on
an OS with ACLs.)

       ~ g r @ eclipsed.net


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug