adding an extra hard disk and adding space to /usr
olli at lurza.secnetix.de
Mon Nov 13 16:24:32 UTC 2006
Andriy Gapon wrote:
> Oliver Fromme wrote:
> > Aaron Burke wrote:
> > > SNIP
> > > > > (FreeBSD 4.x) : cd /usr; tar clpf - . | (cd /mnt; tar xvf -)
> > > > > (FreeBSD 5.x+) : cd /usr; gtar clpf - . | (cd /mnt; gtar xvf -)
> > > > iirc tar(1) has changed in 5.3. why do you use gtar please? is new tar
> > > > missing something?
> > > Well, technically no, but it requires more typing.
> > That's why I prefer to use cpio:
> > cd /usr; find -dx . | cpio -dump /mnt
> > which works on _any_ version of FreeBSD out of the box.
> $ pax rw /usr /mnt
> is even less typing and works on any system with POSIX-compliant
> utilities :-)
For certain definitions of "works". :-)
At the very least you have to add "-p e" (preserve UID/GID
and file mode). And if you don't use it for local copy
mode, you have to remember to add "-x cpio", or otherwise
it won't copy long path names correctly.
I like the find|cpio combination for the great flexibility
that find(1) provides. And while cpio isn't in the current
POSIX standard (neither is tar, FWIW), it's present on all
UNIX systems that I'm using.
It's also important to know that pax doesn't preserve file
flags (cpio neither, though). To make a real 1:1 copy
including file flags, cpdup is easy to use and efficient
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
"To this day, many C programmers believe that 'strong typing'
just means pounding extra hard on the keyboard."
-- Peter van der Linden
More information about the freebsd-stable