Hard Links

The best solution for finding and removing duplicate files.
Post Reply
halaywi
Posts: 5
Joined: Mon Nov 12, 2018 5:24 pm

Hard Links

Post by halaywi »

Could someone please explain to me what Hard links are? Thanks!
User avatar
DigitalVolcano
Site Admin
Posts: 1717
Joined: Thu Jun 09, 2011 10:04 am

Re: Hard Links

Post by DigitalVolcano »

Basically Hard links are a way of linking two or more files to the same source, or bit of data, of the drive. Beware though, as after linking changing one file will change all.

From the manual:
Hard links are only recommended for advanced users.
A hard link is a directory entry for a file. Every file can be considered to have at least one hard link. On NTFS volumes, each file can have multiple hard links, and thus a single file can appear in many directories (or even in the same directory with different names). Because all of the links reference the same file, programs can open any of the links and modify the file. A file is deleted from the file system only after all links to it have been deleted. After you create a hard link, programs can use it like any other file name.

You can only create hard links on NTFS volumes. You cannot create hard links between volumes (different hard drives or network shares). Duplicate Cleaner will only let you hard link same content files.

When creating Hard Links there needs to be at least one file in each duplicate group left unticked. This will be the 'original' file to which the other ticked files in the group are linked. Once linked there will appear to be no difference between the linked file and the original in Windows Explorer. In addition, hard linked files will appear again as duplicates if you re-scan, unless you have the 'Exclude hard linked files from duplicate list' menu option checked.
kbs
Posts: 9
Joined: Thu Jul 30, 2015 9:55 am

Re: Hard Links

Post by kbs »

"there needs to be at least one file in each duplicate group left unticked."

Surely if there is more than one file left unticked there is no way for the function to know which unticked file to use as the original? I would have thought that you need to leave one and only one file unticked. Use the 'drop' function to remove other 'dupes' that you want to keep as well as the original and deleted/linked files.

Example:
File A
File B
File C
File D
File E
appear in a duplicate group (selected e.g. on musical tags, so files may not actually be identical). If you select Files C,D and E and ask it to create hard links, it does not know whether to use File A or File B as the original.

If you drop File A from the group, it will remain unaffected, and hard links can be created for Files C, D and E to point to File B, and the group should then only occupy 1/4 of the physical disk space.

If you copy the affected directories to another volume, I guess a 'real' copy will be created for each file - the hard links would get used and removed in the new volume copy. If you copy to the same volume (new directories), would additional hard links be created rather than real files? I'm assuming using a Windows 10 NTFS volume. I'll have a play to see if I can verify this...
Post Reply