> su
> cd /
> tar cvf foo.tar * --exclude /mnt/*
> cp foo.tar /mnt/other_drive
> cd /mnt/other_drive
> tar xf foo.tar
> 
> Sorry, can't check this, as I only have a few hundred MB left on my hard disk!

All the better to use a pipe, then. The above is OK but you have to be
able to store the tarball somewhere. That's OK (and I've done it many
times) when you have relatively small partitions and enough space to store
a few hundred megs in /tmp while you switch everything around. In fact, I
took that approach while I was moving partitions around and formatting 
everything for reiserfs recently.

Usually you'll do something like:

tar -cf /path/to/where --exclude /mnt/* | (cd /mnt; tar -xf -)

That way, everything in the first tar is piped to the subexpression on the 
other side of the pipe. You need the parentheses here because you want the
other process on the other side of the pipe to be in a different 
subdirectory than the process on the left hand side of that pipe. 

And voila :) no intermediate copy lying around.

> Robin

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to