Tar and hard links.

Sean Estabrooks seanlkml at rogers.com
Sat May 1 18:33:21 UTC 2004


On Sat, 01 May 2004 18:56:46 +0100
WipeOut <wipe_out at users.sourceforge.net> wrote:

<snip>
> Anyway,  I now need to backup the 6 days worth of daily backups (along 
> with other data) to a tape and I will be using tar.. I don't want to 
> have to backup the full volume of 4GB if there is a way to backup the 
> hard links and so save space on the tape..

A hard link is just a directory entry.   When a file is first created it
has one "hard-link".  That is, it has a single directory entry.   When you
 create a new "hard link" you're just creating another directory entry 
that points to the file.

Hard links are indistinguishable from the original file.  Once you've hard
linked a file there is no way for the system to determine which is the
original directory entry  and which is the directory entry you
created with the ln command.

> How does tar handle hard links?? Is there a switch to use or does it 
> handle them automatically??
>
> I looked through the man page and only saw a reference to symlinks but 
> not hard links..

It handles them as regular files.

Cheers,
Sean





More information about the fedora-list mailing list