Re: cp -a
On Sat, 24 Jan 1998, Jason Gunthorpe wrote:
>
> On Sun, 25 Jan 1998, Remco Blaakmeer wrote:
>
> > > 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
>
> Trouble is that cp -ax will not copy /dev it treats them as normal files,
> it might also have problems with fifos and sockets..
>
> tar -cl / | tar -x /mnt
>
> Doesn't have these problems though
I disagree.
# cp -ax /dev /tmp
# cd /tmp/dev
# ls -l hda log ttyS0 xconsole
brw-rw---- 1 root disk 3, 0 Aug 4 20:36 hda
srw-rw-rw- 1 root root 0 Jan 24 16:43 log
crw-rw---- 1 root dialout 4, 64 Jan 25 02:54 ttyS0
prw-r--r-- 1 root root 0 Jan 25 02:54 xconsole
#
Seems fine to me.
Remco
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to:
- Follow-Ups:
- Re: cp -a
- From: Jason Gunthorpe <jgg@gpu.srv.ualberta.ca>
- References:
- Re: cp -a
- From: Jason Gunthorpe <jgg@gpu.srv.ualberta.ca>