gabriel rosenkoetter on Fri, 10 Nov 2000 13:33:42 -0500 (EST)


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

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


On Thu, Nov 09, 2000 at 11:08:56PM -0500, Barry Spindler wrote:
> After formatting and mounting the new partition do 
> 
> 	cp -a /usr/* /mnt/new_part

Ack! No! Don't do that!

cp can *not* be trusted to get permissions right, even with the -a
flag specified, and that wild card will miss dot-files (yes, there
could be some in /usr; don't make presumptions just because you
don't do that).

The *right* way to do this is this:

  # cd /usr
  # tar cfp - . | ( cd /mnt/new_part ; tar xpf - )

cp's man page may claim it'll do this right, but it's wrong, wrong,
wrong on every system I've stress tested it (Slowlaris, BSD, and
yes, god forbid, Linux).

tar'ing up an extra copy of your old /usr and stashing it on /
somewhere till you're sure everything's there wouldn't be a bad
idea.

> This will copy all files (and directories) under /usr, preserving 
> permissions, ownership, and symlinks. Then umount the new partition.
> Change fstab to point the new partition to /usr, move /usr out of the way,
> and mount the new partition to /usr. That should be it.. you shouldn't have
> reboot for this :)

A mount -a should suffice for mounting the new partition at /usr,
and you *definitely* don't need to reboot (why would you ever do
that except on a laptop? ;^>).

       ~ 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