[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] hard link extraction
From: |
Joerg Schilling |
Subject: |
Re: [Bug-tar] hard link extraction |
Date: |
Mon, 22 Oct 2007 17:56:39 +0200 |
User-agent: |
nail 11.22 3/20/05 |
"Dustin J. Mitchell" <address@hidden> wrote:
> Over on the amanda-users list, we just had an interesting problem come up:
> http://marc.info/?t=119261743100002&r=1&w=2
> to summarize, the user is running Cyrus, which makes scads of hard
> links. On doing a restore of only a few files, tar fails because it
> doesn't find the antecedent of hard links.
If the archive was in the star dump format (POSIX-1.2001 + star incremental
dump extensions) you could extract the files with a trick:
star -c -dump MX2 | star -tv -find -ls -false
Release star 1.5a86 (i386-pc-solaris2.9)
Archtype exustar
Dumpdate 1193068207.223226 (Mon Oct 22 17:50:07 2007)
Volno 1
Blocksize 20
6184490 0 drwxr-sr-x 2 joerg bs 0 Jul 29 17:06 MX2/
6184495 134 -rw-r--r-- 3 joerg bs 136663 Jul 19 22:29 MX2/termcap
6184495 0 -rw-r--r-- 3 joerg bs 0 Jul 19 22:29
MX2/termcap12345
6184500 0 -rw-r--r-- 1 joerg bs 0 Jul 22 12:38
MX2/termcap12999
6184501 0 -rw-r--r-- 1 joerg bs 0 Jul 22 12:40
MX2/termcap00999
6184495 0 -rw-r--r-- 3 joerg bs 0 Jul 19 22:29 MX2/termcap1
6184521 2 -r--r--r-- 2 joerg bs 1972 Jul 10 00:04 MX2/Makefile
6184521 0 -r--r--r-- 2 joerg bs 0 Jul 10 00:04 MX2/lM
-dump switches to the "exustar" archive format + dump extensions.
-find -ls -false uses find(1)'s ls code instead of the star listing so you see
the inode numbers.
As you now know the inode number for MX2/termcap (6184495) you could run:
star -cPM -dump MX2 | star -tv -find -inum 6184495
Release star 1.5a86 (i386-pc-solaris2.9)
Archtype exustar
Dumpdate 1193068476.685381 (Mon Oct 22 17:54:36 2007)
Volno 1
Blocksize 20
136663 -rw-r--r-- 3 joerg/bs Jul 19 22:29 2007 MX2/termcap
0 -rw-r--r-- 3 joerg/bs Jul 19 22:29 2007 MX2/termcap12345 link to
MX2/termcap
0 -rw-r--r-- 3 joerg/bs Jul 19 22:29 2007 MX2/termcap1 link to
MX2/termcap
which only lists the file names related to the link. If you use -x instead of
-t, the related files will all be extracted.
Could this help?
Jörg
--
EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
address@hidden (uni)
address@hidden (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily