Many file systems support "hard links" where a file appear under several different names. The names are all equally good and the underlying storage is only freed when all names are deleted.
Questions tagged [hardlink]
68 questions
4
votes
2 answers
Get hardlink count for a file on Windows (without fsutil, which requires admin)
I have various files which I've created as hardlinks to others using mklink. I need a command I can use inside a batch file to determine which files in a given directory have only one link to it. I know fsutil hardlink list can show me the links,…

Display Name
- 761
- 1
- 8
- 13
4
votes
1 answer
hardlink of ms word file getting hidden and not updated
I created a docx file in windows 7 with some text in it (initial.docx) and then I created a hardlink to it:
mklink /H new.docx initial.docx
I open new.docx and I can see the text that I initially typed in initial.docx. Now I type some more text in…

Ben2209
- 153
- 4
4
votes
2 answers
Samba breaking hard links - desired behaviour?
I'm using Samba 2:3.5.4 in Ubuntu 10.10 Server, and an EXT4 filesystem.
I have setup a folder "dev" locally on my pc, and using "cp -alf" hard
linked that folder, to folder "test". So upon looking in the "test" folder it has exactly the same…

Bealer
- 141
- 1
- 3
4
votes
1 answer
How to tell Mercurial to never create hard links
I am planning to use Mercurial in the near future on some projects. These projects will normally reside in a directory on my Windows machine, but I will be sharing these directories using VirtualBox so I can work on them directly from within…

scrapdog
- 153
- 3
3
votes
0 answers
Cheating with hard links and NFS
At what layer does the magic occur that allows me to hardlink files between two NFS mounts on the client when they’re on the same file system on the server? Also, can I trust these to act like normal hardlinks? Yes, this is a real thing that I see…

Keith Russell
- 151
- 3
3
votes
1 answer
How do I grant users permission to create hard links (using GPO or registry entries)?
I'm working in an AD domain with one DC running Windows Server 2012 R2, and clients running mostly Windows 7 Professional.
I need to be able to grant certain user groups the permission to create hard links, hopefully via mklink /H SINK SOURCE.
I've…

snoopy91
- 243
- 3
- 10
3
votes
4 answers
3
votes
1 answer
Rsnapshot to multiple destinations (or maintain hard links structure)
I'm doing a backup of multiple external servers on a local machine using rsnapshot and it's working beautifully. Now, I'd like to clone the destination snapshots on an external disk that will be rotated. The thing is, I'd like to maintain the hard…

lpfavreau
- 439
- 2
- 8
- 19
2
votes
1 answer
Calculate folder size without counting links
I need to calculate the size of "real" files created under a folder (and its sub-folders) on an NTFS drive, where "real" is all files that are not present because of hard/soft-links, junctions etc.
Is there currently any tool that will do this?…

Doc
- 121
- 4
2
votes
0 answers
Which attributes/descriptors are changed by hardlinking a file on Windows?
I'm working on a little backup script using robocopy and hardlinks. My aim is to have differential backups using similar concept as rsync's --link-dest without having to resort to 3rd party tools. For those unfamiliar, the concept is that the first…

Disassembler
- 246
- 2
- 7
2
votes
1 answer
Hard or soft link is more useful in Linux?
In small scale Linux infrastructure environment which link to the file is more helpful, hard or soft link?
As a beginner in Linux administration, I have found that most Linux admins tend to use soft links over hard link. Even though the link may be…

Chandan Hegde
- 23
- 6
2
votes
3 answers
Is it possible to have orphaned hard links?
I'm not sure if it is even possible to have an orphaned hard link. Let me explain why I'm asking. Bear with me.
My Setup
I am using rsync to sync my file server to my backup server. I am using the --link-dest rsync option to create a…

zechdc
- 135
- 5
2
votes
2 answers
rsync apparently breaks hard links
On the source server (A), I got a file
/opt/resources/xxx
and a hard link
/etc/apache2/sites-available/xxx pointing to this file.
On another server (B) I got the same structure
/etc/apache2/sites-available/xxx hard linked to /opt/resources/xxx
I…

Francis Martens
- 169
- 1
- 7
2
votes
3 answers
Under Linux, how do I copy files from one filesystem to the other (both gpfs) and preserve hard links?
I have a directory with huge files and a number of directories, that have hardlinks on these huge files. How do I copy files from one filesystem to the other and preserve hard links?

Anton Daneyko
- 123
- 6
2
votes
4 answers
Does number of hardlinks to a directory correspond to the number of subdirectories in it?
When displaying directories using ls -l, their number of links (the second field in the output) is at least two: one for the dir name and one for .
$ mkdir foo
$ ls -l
total 2
drwxr-xr-x 2 user wheel 512 4 oct 14:02 foo
Is it safe to always…

Eugene Yarmash
- 2,433
- 5
- 34
- 54