[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Unexpected behaviour when creating a tarball with -h: symlinks are repla
From: |
Mirko Vogt |
Subject: |
Unexpected behaviour when creating a tarball with -h: symlinks are replaced with hardlinks |
Date: |
Fri, 14 Aug 2020 16:29:08 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
Hello,
I just experienced an unexpected GNU tar behaviour involving "-h".
>From my understanding -h de-references symlinks and includes the files
the symlinks point to instead of preserving the symlinks.
This understanding - if I'm not misreading the man page - pretty much
matches the description of this option.
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.
Tar: tar (GNU tar) 1.30
OS : Debian/Buster
Thanks in advance
mirko
- Unexpected behaviour when creating a tarball with -h: symlinks are replaced with hardlinks,
Mirko Vogt <=