Re: cp -a
On Sat, 24 Jan 1998, Santiago Vila Doncel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> On Fri, 23 Jan 1998, Ulisses Alonso Camaro wrote:
> > I would like to know why cp -aR is not useful to replicate a disk
> Since cp -a [*] is useful to replicate a disk, I think you are really
> asking "I would like to know why some people seem to prefer tar or cpio
> to replicate a disk".
> Well, I don't know the answer, but in either case, you have often to be
> careful to avoid infinite recursive copying:
> cd /
> mount /dev/somedisk /mnt
> cp -a * /mnt
> See the mess? ( /mnt/mnt/mnt/... )
You could add the -x switch. This skips subdirectories that are not on the
same filesystem as the directories you are copying.
cp -ax / /mnt
would only copy the root filesystem to /mnt and not things like /proc, an
accidentally mounted floppy or a /usr which is on a different filesystem.
If /usr is on a different filesystem, simply do
cp -ax / /usr /mnt
to copy both filesystems to /mnt .
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to email@example.com .
- Re: cp -a
- From: Jason Gunthorpe <firstname.lastname@example.org>
- Re: cp -a
- From: Santiago Vila Doncel <email@example.com>