(Thanks)Re: cp -a

1998-01-28 Thread Ulisses Alonso Camaro
Hi all!

I would like to thank everybody who answered my question, I could not
reply before cause I'm on exams :-(

Cheers,

Ulisses


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: cp -a

1998-01-25 Thread Jason Gunthorpe

On Sat, 24 Jan 1998, Brandon Mitchell wrote:

> > Weird, I did this not two days ago, cp -avRx /* . and it died on some
> > file, I thought it was /dev or a fifo? 
> 
> Say "." is /tmp.  When you get to copying /tmp, you will get into
> recursion with /tmp/tmp being everything that you have copied into /tmp
> including the directory /tmp/tmp which will become /tmp/tmp/tmp...  I
> usually make sure to get every directory but the one I'm copying into.  Or
> using a rescue disk to I can have /mnt1 and /mnt2.  Or using a tar that
> won't traverse mount points, etc...

Actually it was /mnt/Linux and I was using the -x option to only traverse
one disk :>

My memory must be going or something :>

Jason


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: cp -a

1998-01-25 Thread Brandon Mitchell
> Weird, I did this not two days ago, cp -avRx /* . and it died on some
> file, I thought it was /dev or a fifo? 

Say "." is /tmp.  When you get to copying /tmp, you will get into
recursion with /tmp/tmp being everything that you have copied into /tmp
including the directory /tmp/tmp which will become /tmp/tmp/tmp...  I
usually make sure to get every directory but the one I'm copying into.  Or
using a rescue disk to I can have /mnt1 and /mnt2.  Or using a tar that
won't traverse mount points, etc...

HTH,
Brandon



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: cp -a

1998-01-25 Thread Jason Gunthorpe

On Sun, 25 Jan 1998, Remco Blaakmeer wrote:

> 
> 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 root0 Jan 24 16:43 log
> crw-rw   1 root dialout4,  64 Jan 25 02:54 ttyS0
> prw-r--r--   1 root root0 Jan 25 02:54 xconsole
> #
> 
> Seems fine to me.

Weird, I did this not two days ago, cp -avRx /* . and it died on some
file, I thought it was /dev or a fifo? 

That begs the question, what was wrong with that machine? :<

Jason


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: cp -a

1998-01-25 Thread Remco Blaakmeer
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 root0 Jan 24 16:43 log
crw-rw   1 root dialout4,  64 Jan 25 02:54 ttyS0
prw-r--r--   1 root root0 Jan 25 02:54 xconsole
#

Seems fine to me.

Remco


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: cp -a

1998-01-25 Thread Jason Gunthorpe

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

Jason


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: cp -a

1998-01-25 Thread Remco Blaakmeer
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 .

Remco


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: cp -a

1998-01-24 Thread Santiago Vila Doncel
-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/... )


[*] -a does already include -R, see cp --help.

-BEGIN PGP SIGNATURE-
Version: 2.6.3i
Charset: latin1

iQCVAgUBNMpAZSqK7IlOjMLFAQF24QQAkAsItNB+VDPCUEiuushF/QoZYbHQjAXD
NNRCJpICk9NENYCxGqC2glHs0ETdzTyfe+TWmVkQ3AiNTAsras+Cva9tbi/6U75Z
CZF9TV2zWb9Rm/5Zfw3Yv+axh2/uGv/IrVtVoL0R2PsSG2t0YTsz0v71x/quT3q+
tlDT7l6qu9A=
=dkH7
-END PGP SIGNATURE-



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .