How much space do NTFS hardlinks/symlinks occupy?

2

Well, I guess it must be something proportional to the original filename plus the new filename for symlinks, and only the new filename for hardlinks, but how does this affect the disk space exactly? I just made a folder with about a hundred thousand symbolic links in it, and the folder still reported 0 bytes usage. I even think the free capacity of the drive remained the same. Then I permanently deleted the folder and the sizes still stayed the same.

Could I fill up a hard disk just with symlinks? Or does NTFS have a limitation that no more than X symlinks are allowed on one drive/in one folder, so the capacity of the drive cannot be reached?

Felix Dombek

Posted 2011-03-10T15:35:20.777

Reputation: 1 729

Answers

2

The OS is reporting how much disk space each of the file's contents consume. The entry in the file table (which is what contains your list of files) is not included in this.

Often multiple file entries are normally stored on one sector.

If you keep creating files in a directory, eventually you'll notice that the total free disk space decreases just a little bit as an additional sector is allocated to store more filename entries.

Typically other information is stored along with each filename entry, such as various timestamps, owner ID, starting sector, size, attributes, permissions, etc.

Now symbolic links and hard links are just references to existing files, so additional disk space is not needed for data (file content) storage since a copy of the destination file isn't created as a result.

Randolf Richardson

Posted 2011-03-10T15:35:20.777

Reputation: 14 002

0

What happens when you format your disk is that certain space is reserved at format time for file names and other file-system metadata. This space is typically located at the back of the partition. If you use all of the reserved space it will just allocated more, and at this point you will see the free space decrease for the drive.

Joel Coehoorn

Posted 2011-03-10T15:35:20.777

Reputation: 26 787

0

You will most likely run out of directory entries on the drive before you'll run out of space on the drive. Just run CHKDSK on the drive and you'll see how many "allocation units available on disk" are available.

J. Chin

Posted 2011-03-10T15:35:20.777

Reputation: 213