bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unexpected behaviour when creating a tarball with -h: symlinks are r


From: Joerg Schilling
Subject: Re: Unexpected behaviour when creating a tarball with -h: symlinks are replaced by hardlinks
Date: Thu, 13 Aug 2020 12:45:21 +0200
User-agent: Heirloom mailx 12.5 7/5/10

"bug|gnutar@nanl.de" <bug|gnutar@nanl.de> wrote:

> However what I'm experiencing is - while -h indeed does not preserve the
> symlinks - it replaces them with hard links instead of actually
> de-referencing them and including the original file.
>
> This in particular is an issue, if you want to create a tarball for a
> filesystem which doesn't support any of such link types - e.g. FAT.
>
> So when extracting the tarball (created with -h) on a FAT filesystem,
> I'm experiencing errors like:
>
> tar: dir/target: Cannot hard link to ?dir/origin?: Operation not permitted
>
> And nothing ends up where a symlink was present when creating the archive.

Given that this is a common problem on non-POSIX platforms, 20 years ago star
introduced support to unpack archives on non-POSIX platforms by using the 
options:

-copylinks

-copyhardlinks

-copysymlinks

-copydlinks

See star man page http://schilytools.sourceforge.net/man/man1/star.1.html
the related parts are currently on page 17.

There is also the option

-hardlinks

see page 33, that tells star to unpack symlinks as hardlinks, which works
on platforms like BeOS or Haiku.

And finally, there is 

-link-data

see page 35, which is allowed for the POSIX.1-1988 TAR archive format and later 
versions. -link-data tells star to archive the data again for hardlinkes files.

Jörg

-- 
 EMail:joerg@schily.net                    (home) Jörg Schilling D-13353 Berlin
    joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]