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

Re: Copying Linux to a new drive

On Mon, 30 Jul 2001, Willi Dyck wrote:

>           $ find . -print0 | cpio -pvdn0 /dev/[destination]
> This should copy everything to the defined destination. Even
> other mountpoints. If you only want to copy the mountpoint your are in,
> try this:
>           $ find . -xdev -print0 | cpio -pvdn0 /dev/[destination]

This is a question I've been curious about for some time.  Why not just do
a tar?  tar copies links by default (not the files they point to) and
preserves UID's and GID's, ans also permissions with the p option.  There
is also the -l or --one-file-system option to only archive files in
the local file system as does cpio with -xdev.

Am I missing something here?

I usually format the partition, mount it and do

tar cpf - -C <source-parent-dir> <source-dir> | tar xvzpf - -C 

(text format has split the line, but you get my drift).

It seems to work for me.  Am I doing something wrong?

George Karaolides       8, Costakis Pantelides St.,
tel:   +35 79 68 08 86                   Strovolos, 
email: george@karaolides.com       Nicosia CY 2057,
web:   www.karaolides.com      Republic  of Cyprus

Reply to: