🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.redhat
Article #41

Re: a problem with tar

#41
From: 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
Technical Details
Message-ID: <3C3D7FA7.80319857@zrz.TU-Berlin.DE>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!unlisys!news.snafu.de!zrz.TU-Berlin.DE!not-for-mail
References: <paris-0901021008260001@0036.psp.ucl.ac.be>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 100a19,37af4fbb9db9cd14
X-Google-Attributes: gid100a19,public
X-Google-Thread: 109d4a,37af4fbb9db9cd14
X-Google-Attributes: gid109d4a,public
X-Google-Thread: fe2cf,37af4fbb9db9cd14
X-Google-Attributes: gidfe2cf,public
X-Google-Thread: 113682,37af4fbb9db9cd14
X-Google-Attributes: gid113682,public
X-Google-ArrivalTime: 2002-01-10 03:48:56 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!unlisys!news.snafu.de!zrz.TU-Berlin.DE!not-for-mail
From: Herbert Pophal <pophal@zrz.TU-Berlin.DE>
Newsgroups: linux.redhat,be.comp.os.unix,be.comp.os.linux,ucl.comp.os.linux
Subject: Re: a problem with tar
Date: Thu, 10 Jan 2002 12:48:55 +0100
Organization: Technical University Berlin, Germany
Lines: 54
Message-ID: <3C3D7FA7.80319857@zrz.TU-Berlin.DE>
References: <paris-0901021008260001@0036.psp.ucl.ac.be>
NNTP-Posting-Host: gaudi.zrz.tu-berlin.de
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.14-5.0 i686)
X-Accept-Language: en