🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by B. Paris Wed, 09 Jan 2002 09:08
a problem with tar
#39
Author: B. Paris
Date: Wed, 09 Jan 2002 09:08
26 lines
1978 bytes
I use i386 redhat7.1 with kernel 2.4.14.

I don't understand this tar problems, any help would be appreciated:

- I make a tar archive of the exclusive root partition in a file on a
different filesystem  (mounted on /mnt/diskC) :

% tar cplf /mnt/diskC/aa.tar /


- When I make

% cd /mnt/diskC ; tar xf aa.tar

I get some errors like 
tar: /bin/gzip: Cannot link to bin/gzip: Invalid cross-device link
tar: bin/gunzip: Cannot link to bin/gunzip: Invalid cross-device link
tar: sbin/dosfsck: Cannot link to sbin/dosfsck: Invalid cross-device link
tar: sbin/mkdosfs: Cannot link to sbin/mkdosfs: Invalid cross-device link

This is curious as - for example - /bin/gzip is not a link but a real
file. Furthermore, where could it be a cross-device problem there ??

Bernard Paris
Universite Catholique de Louvain
PSP - iPSP
Re: a problem with tar
#40
Author: Bill K.
Date: Wed, 09 Jan 2002 14:09
34 lines
2283 bytes
You seem to be writing the tarfile to the same filesystem you're tarring.
This might cause a problem, but I don't see how it would cause what
you're describing.

In article <paris-0901021008260001@0036.psp.ucl.ac.be>, "B. Paris"
<paris@ipsp.ucl.ac.be> wrote:

> I use i386 redhat7.1 with kernel 2.4.14.
> 
> I don't understand this tar problems, any help would be appreciated:
> 
> - I make a tar archive of the exclusive root partition in a file on a
> different filesystem  (mounted on /mnt/diskC) :
> 
> % tar cplf /mnt/diskC/aa.tar /
> 
> 
> - When I make
> 
> % cd /mnt/diskC ; tar xf aa.tar
> 
> I get some errors like
> tar: /bin/gzip: Cannot link to bin/gzip: Invalid cross-device link tar:
> bin/gunzip: Cannot link to bin/gunzip: Invalid cross-device link tar:
> sbin/dosfsck: Cannot link to sbin/dosfsck: Invalid cross-device link
> tar: sbin/mkdosfs: Cannot link to sbin/mkdosfs: Invalid cross-device
> link
> 
> This is curious as - for example - /bin/gzip is not a link but a real
> file. Furthermore, where could it be a cross-device problem there ??
> 
> Bernard Paris
> Universite Catholique de Louvain
> PSP - iPSP
Re: a problem with tar
#41
Author: Herbert Pophal
Date: Thu, 10 Jan 2002 11:48
54 lines
3192 bytes
"B. Paris" wrote:
> 
> I use i386 redhat7.1 with kernel 2.4.14.
> 
> I don't understand this tar problems, any help would be appreciated:
> 
> - I make a tar archive of the exclusive root partition in a file on a
> different filesystem  (mounted on /mnt/diskC) :
> 
> % tar cplf /mnt/diskC/aa.tar /
> 
> - When I make
> 
> % cd /mnt/diskC ; tar xf aa.tar
> 
> I get some errors like
> tar: /bin/gzip: Cannot link to bin/gzip: Invalid cross-device link
> tar: bin/gunzip: Cannot link to bin/gunzip: Invalid cross-device link
> tar: sbin/dosfsck: Cannot link to sbin/dosfsck: Invalid cross-device link
> tar: sbin/mkdosfs: Cannot link to sbin/mkdosfs: Invalid cross-device link
> 
> This is curious as - for example - /bin/gzip is not a link but a real
> file. Furthermore, where could it be a cross-device problem there ??
First, /bin/gzip _is_ a link. It is identical to /bin/gunzip and
/bin/zcat, as you might see in the following lines:

find /bin  -inum 1287 -ls
  1287   56 -rwxr-xr-x   4 root     root        50652 Feb  8  2001
/bin/zcat
  1287   56 -rwxr-xr-x   4 root     root        50652 Feb  8  2001
/bin/gunzip
  1287   56 -rwxr-xr-x   4 root     root        50652 Feb  8  2001
/bin/gzip

Since tar strips the initial /, as you have called it, tar restores
bin/zcat in your current directory when untarring (/mnt/diskC) and then
tries to link bin/gzip to /bin/zcat, which _is_ a cross device link. If
you list your tarfile via tar tf, you will see these links
(unfortunately this is german, but the word 'Link' should be quite
clear):

[..]
-rwxr-xr-x root/root     50652 2001-02-08 16:39:04 bin/zcat
-rwxr-xr-x root/root         0 2001-02-08 16:39:04 bin/gunzip Link auf
'/bin/zcat'.
-rwxr-xr-x root/root         0 2001-02-08 16:39:04 bin/gzip Link auf
'/bin/zcat'.
-rwsr-xr-x root/root     22620 2001-01-16 16:34:21 bin/ping
[..]

Probably you might be more satisfied with cpio

HTH
Herbert
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads