windows - How much space do NTFS hardlinks/symlinks occupy?

28
2013-09
  • Felix Dombek

    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?

  • Answers
  • Randolf Richardson

    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.

  • Joel Coehoorn

    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.

  • J. Chin

    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.


  • Related Question

    NTFS symlinks in linux
  • hasenj

    I have an NTFS formatted drive (from a previous windows installation) and it contains some symlinks (reparse points),

    For some reason, I can't do anything with these symlinks: I can't go to where they link to, I can't even delete them.

    I guess the reason has to be that the link contained C:\ as a part of it.

    How can I deal with this issue?

    UPDATE:

    To clarify, these links are junctions/reparse points.

    For instance, I had C:\progs be a symlink to C:\Program Files

    If I try to remove it, I get:

    $ rm /media/disk/progs/ -rf
    rm: cannot remove directory `/media/disk/progs': Operation not supported
    

    I actually removed /media/disk/Program Files/ anyway.

    UPDATE2:

    My system is linux mint (ubuntu based)


  • Related Answers
  • Pascal Thivent

    As explained in the Questions & Answers of the NTFS-3G support section, deleting a Reparse Point is not fully supported by the NTFG-3G driver. You might have to install the Advanced NTFS-3G driver:

    Why do I get an "Operation not supported" message when deleting a file?

    The NTFS-3G 1.5012 driver has solved this issue, or you're trying to delete an NTFS Reparse Point which is not fully supported yet in Stable NTFS-3G, only in the Advanced NTFS-3G version of the driver.

    I can't provide more specific guidance without more informations on your Linux distribution, version, etc.

  • Martin v. Löwis

    Try using ntfs3g. You may have to create a file /.NTFS-3G if you have symlinks to a different drive letter.