Windows hard links disk usage inconsistency
Asked Answered
T

1

1

I'm using Windows 8.1.

There appears to be an inconsistency. Windows states adding hardlinks to a file doesn't use much disk space, and this makes sense since you're only creating a pointer.

However, the file system doesn't reflect this. If I create a hardlink, it lists the disk space usage for that file as doubled.

If doing this only adds a pointer but the FS thinks it's doubled, then it doesn't matter how much space the file is actually using when calculating remaining disk space if what the FS thinks is only taken in consideration.

So what gives? Which is it? Which is being considered when calculating remaining disk space? Appreciated!

Trial answered 21/1, 2015 at 21:47 Comment(6)
You should specify how you are calculating the disk space usage.Jaan
I am highlighting the original file plus all the hardlinks and then looking at the total size in the context menu 'Properties'.Trial
If you ask explorer.exe to give you the size of a file, it will give you the size of the file, it doesn't care if it is hard-linked. To determine disk utilization you should call GetDiskFreeSpaceEx or a similar API.Jaan
My question is what explorer.exe says it is using being considered when calculating remaining disk space? Or is the disk space it is actually using being considered. Because obviously what explorer.exe says it is using is in fact wrong.Trial
Let me rephrase. Would it take the same number of hardlinks pointing to a large image in a drive to fill up the disk space as it would had you copied that large image the same number of times? In other words does creating hard links really save disk space or is this supposed advantage a myth because the OS treats hardlinks like copies of the same file rather than just pointers?Trial
Explorer isn't the file system. The fact that Explorer doesn't take hard links into account when calculating the total size of a group of files doesn't affect the amount of disk space available. (If you look at the properties of the drive rather than of a particular set of files, Explorer asks the file system for the actual amount of space used and available on the volume. Those figures are correct.)Jacquelinjacqueline
T
4

According to Harry Johnston:

"Explorer isn't the file system. The fact that Explorer doesn't take hard links into account when calculating the total size of a group of files doesn't affect the amount of disk space available. (If you look at the properties of the drive rather than of a particular set of files, Explorer asks the file system for the actual amount of space used and available on the volume. Those figures are correct.)"

This was the answer I was looking for. Thanks!

Trial answered 22/1, 2015 at 5:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.