Re: Hard link and disk usage

On Wed, 11 Apr 2007 17:19:38 +0200 Michael Schnell <mschnell_at_lumino_dot_de@xxxxxxxxxxx> wrote:

| I understand that the size of a directory is just a virtual number,
| adding the size of all files that are accessible within that directory.
| Thus doing a hard link to an existing file in the same directory will
| increase the directory size but not the used disk size. On a disk with
| many hard links the size of a single directory might be much higher than
| the drive capacity.

That depends on whether the tool used to add up those numbers also takes
into account the hard links. The "du" command I have tries to do that.
It also does it badly when hardlinks to the same file are in different
directories: it counts the whole file in the total for the first directory
but not for the next directory. But there is no clear right way to show
this for files with hard links spanning directories. Once the total gets
up to a parent directory covering all links to the file, then the figure
should be correct from a hard link aware "du".

| Phil Howard KA9WGN ( / Do not send to the address below |
| first name lower case at / spamtrap-2007-04-23-1117@xxxxxxxx |