[plug] Data recovery with Gentoo system rescue cd

Craig Ringer craig at postnewspapers.com.au
Fri Jul 23 16:59:56 WST 2004


On Fri, 2004-07-23 at 16:45, caston at arach.net.au wrote:

> Right now I am doing cp -r * 

Hmm. If you're copying things like /usr, /var, or /dev you'll want to
use cp -aR instead of cp -r. 'cp -r' doesn't deal well with some special
files, particularly device nodes and fifos.

If you use 'cp -r' your copy may stall partway through when it finds a
fifo, and it may not preserve all file attributes, symlinks, etc.

> The source is ext3 and the target is ext2. I was in such a rush that I didn't 
> adding journaling to the new disks file system.
> 
> What is the difference between this and cpio -p ?

cpio is a (rather old) archival tool in much the same style as tar. It
has a handy passthrough mode where it can read a list of files from
stdin and for each file copy it to a target directory. I've found 'cpio
-p' to be faster for many small files than 'cp -aR' is. You should get
the same effect as cpio by using

(cd /source && tar cvf - . )|(cd /destination && tar xvf -)

which I probably should've suggested instead, I'm just used to cpio
myself so it tends to come to mind first.

--
Craig Ringer




More information about the plug mailing list