Windows hard link taking up space?

Posted on

QUESTION :

On my computer I create a hard link

mklink /h git-link.exe git.exe
Hardlink created for git-link.exe <<===>> git.exe

Now they both take up space

2012-04-17  12:14 AM         6,905,039 git-link.exe
2012-04-17  12:14 AM         6,905,039 git.exe

What’s the point of this? Why not just make a copy?

ANSWER :

When you create a hardlink, you are creating two separate file system entries pointing to the same physical data on the disk.

When you do a dir, it displays the size of the data being stored at the location the file system entry is pointing at.

So if you create 100 hard links to a single file, they will all report the same size – they are reporting the size of the data stored. This does not mean that the hardlinks take up this space – in fact they do not. A hard link takes up very little space.

Fact is, there is no point in ever using directory hard links (junctions), is there ?

Considering the way they are handled by explorer, that is.

My point, using an example : one cannot hope to alleviate disk ‘C’ from its physical payload (moving appdata folders or program files to another disk ‘E’ and using hardlinks to repopulate ‘C’, thus keeping apps working). Windows explorer will still accumulate those links “sizes” to the -presumably- consumed space on ‘C’, throwing warnings at its user’s face as soon as disk ‘C’ lacks free space, even if it relates to hardlinks “virtual” space consumption.

So, Windows 7’s hard links ? Big disappointment.

Leave a Reply

Your email address will not be published.