Tannin42 Posted July 6, 2018 Share Posted July 6, 2018 A file on your disk always consists of two parts, one is all the "meta" information like the file name, attributes, permissions, creation/modification times and so on. The other part is the actual file data.A hard link creates a copy of the meta part but it doesn't duplicate the file data. So no, it's not using 2 times the disk space.They aren't so much like a shortcut because there is no "real" file and a "link" with hard links. Both are fully functional files. If you have "orig.txt" and create a hard link "link.txt", no additional disk space is used (except for a few hundred bytes maybe for the meta information of link.txt)If then you delete "orig.txt", no disk space is freed and the "link.txt" would still work. Only when you then also delete link.txt is space freed. But since hard links are handled on the filesystem level, in a driver, most applications can't tell when a file is a hard link, they will not dig deep to find out that two files share the same data, so when they iterate over a directory and add up the file sizes, they will count both "original" and "link". tl;dr: no, hard links don't take twice the disk space but they confuse the s#*! out of applications. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.