Questions tagged [hardlink]

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 views

Total space in bkps using rsync and hardlinks: who is right between du and Synlogy web interface?

I bkp my server root partition on a Synology NAS (fs: btrfs) mounted as NFS on /mnt/bkps using this script that is based on rsync and hard links, to to have daily bkps. If I check the space using du ...
Antonello's user avatar
  • 147
2 votes
0 answers
525 views

Why hard link doesn't corrupt if we remove the original file? [migrated]

Why the hard link doesn't corrupt if we remove the original file? If I remove the original file then the softlink gets corrupt but hard link doesn't so why it does't corrupt
Rahul Sharma's user avatar
0 votes
1 answer
71 views

Extract hard linked backup data from file server with rsync to exFAT file system

I need to gradually extract all data of the specific directory from Time Machine backup so: it fits the destination drive size it has no hard links because destination volume file system is exFAT it'...
bananakid's user avatar
0 votes
0 answers
17 views

Cwd of a process started from hard link path

I have an app which is starting by path which contains a folder which is hard link. If I look for process current working directory it is same as source of a hard link. The main problem is that app ...
Ruslan F.'s user avatar
  • 101
0 votes
1 answer
367 views

NAS de-duplication best practices - how do hardlinks handle compression?

I just joined a SMB as their first full-time tech guy, and the company's backup architecture is a mess. Leaving aside all other issues (of which there are many), the office has multiple different NAS ...
Ballyhoo's user avatar
0 votes
1 answer
494 views

ln: failed to create hard link: Too many links

I have a pipeline on my server which creates a lot of hard links to big files. today I realized it fails and shows this error: ln: failed to create hard link to '/path/to/a/file': Too many links The ...
asalimih's user avatar
  • 101
0 votes
1 answer
189 views

Windows hardlinks - why it consumes same space as original file

Im using finddupe tool to de-duplicate files and save some space on HDD. But checking before and after operation I cant see any free space released - see below. Can somebody advise what is wrong here ?...
Maciej's user avatar
  • 123
2 votes
1 answer
156 views

Why is rsync only hard linking some unchanged files?

I'm using rsync for incremental backups, using the --link-dest option to point to the previous backup so that unchanged files are hard linked to there. This is working, but not for all files. For ...
IpsRich's user avatar
  • 185
0 votes
1 answer
247 views

It is possible that a process can not link a file, but I can with sudo for the same user?

I am working with Dovecot 2.3.4.1 and EncFS (encfs version 1.9.5) encrypted mailboxes on Debian 10 (no SELinux) Basic setup is: EncFS mounted with encfs --public /var/encrypted-mail /var/decrypted-...
func0der's user avatar
  • 164
2 votes
2 answers
2k views

Does rsync preserve hardlinks on the destination when source files are identical but separate?

I am running a (Linux based) rsync server for software distribution. A (Windows based) source repository server which is outside my control pushes software packages to it via rsync, and about a ...
Tilman Schmidt's user avatar
1 vote
0 answers
112 views

rsync -H with --link-dest and potential link corruption

man rsync for -H includes: "If you specify a --link-dest directory that contains hard links, the linking of the destination files against the --link-dest files can cause some paths in the ...
Gareth's user avatar
  • 31
1 vote
0 answers
210 views

libvirt qemu AppArmor 9p hard links

I am using libvirt with qemu on a debian host. One virtual machine has a 9p mount point defined: <filesystem type='mount' accessmode='mapped'> <source dir='/mnt/pool/share'/> <...
felinira's user avatar
  • 111
0 votes
0 answers
161 views

rsync duplicate tree using hard links

I would like to duplicate a folder structure containing many directories and files using hard links for all the files instead of making new copies of the files. I thought I could do this with rsync, ...
lbutlr's user avatar
  • 113
0 votes
0 answers
461 views

Issue Hardlink/Junction not working when chroot all users to c:/share dir in Windows OpenSSH Server 2019

Issue Hardlink/Junction not working when chroot all users to c:/share dir in Windows OpenSSH Server 2019. Link Created mklink /d E "E:" mklink /d F "F:" Entry in sshd_config file ChrootDirectory c:/...
user524121's user avatar
2 votes
3 answers
481 views

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. ...
Doc's user avatar
  • 121
0 votes
1 answer
2k views

Best way to find all hard links to a directory

I am tracking down what may be a stray or erroneous hard link to a directory, so I want to find all the hard links to a directory to manually verify them. (fsck finds no errors, but the link count ...
Old Pro's user avatar
  • 1,475
2 votes
0 answers
299 views

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 ...
Disassembler's user avatar
13 votes
1 answer
803 views

Does rsync change file content (dealing with hardlinks)?

Imagine I have a file remote/A which syncs to local/A and local/B is a hardlink of local/A. Is there a threat that on a next remote/A change and synchronization rsync will not delete local/A but only ...
user619271's user avatar
-2 votes
1 answer
782 views

How to detect hardlinks over network share?

I swear I had this working at one point ages ago but now it's not. I have a Windows 10 machine with a Linux network share. I can create hard links on the network share just fine, but I cannot detect ...
user2328273's user avatar
3 votes
0 answers
2k views

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 ...
Keith Russell's user avatar
0 votes
3 answers
289 views

have 2 folders on different disks behave as if they were 1 folder

I have a server with two 1TB hard drives. I have an uploads folder on /disk2/uploads, That folder has filled up the entire hard drive. The other disk is basically empty. I want to have a spill ...
ajon's user avatar
  • 319
2 votes
1 answer
105 views

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 ...
Chandan Hegde's user avatar
0 votes
0 answers
761 views

Should I use symbolic links or hard links (and junctions) for web server?

I understand the differences between hard links (or junctions/soft links for directories) and symbolic links. Are there performance/security benefits for one or the other for web server usage?
Brian Leishman's user avatar
0 votes
1 answer
465 views

Does rsync -H convert file to hard link on destination after deduplication on source?

I've got two servers, the second one being synced via rsync every now and then. I've got some (few thousands ?) of big duplicate files on which I would like to use freedup to spare some space. If I ...
vincent.m's user avatar
4 votes
2 answers
3k views

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 ...
Display Name's user avatar
0 votes
1 answer
55 views

Why hasn't disk usage decreased by 6,728k after hard linking a file away?

Given this sequence of commands… $ pwd /data/backup/rsnapshot $ sudo du -csk daily.{2,3}/ruminant 1195040 daily.2/ruminant 36712 daily.3/ruminant 1231752 total $ ls -isk /data/backup/rsnapshot/...
grifferz's user avatar
  • 958
2 votes
3 answers
497 views

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 -...
zechdc's user avatar
  • 135
3 votes
1 answer
2k views

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 ...
snoopy91's user avatar
  • 243
6 votes
1 answer
675 views

Recalculate Windows inherited ACLs for hardlinks

How do I get Windows to recalculate the inherited permissions of a file? A tool (Mercurial) created multiple NTFS hardlinks to the same file from different directories. I can see them using fsutil ...
Peter's user avatar
  • 171
0 votes
2 answers
786 views

All of the NTFS hard links disappear, where are those 0KB hardlinks stored on disk and how to recover them?

This is Windows 7 x64 sp1 on a NTFS file system. All hardlinks within C:\Windows\System32 folder disappear, and the Windows can't boot, because even the osloader, C:\Windows\System32\boot\Winload.exe ...
Osiris's user avatar
  • 101
10 votes
1 answer
8k views

Create a link to the Unix socket [duplicate]

Is there a possibility to create a hard link for an unix socket? I'm creating a jail and symbolic links won't work, so I'm looking for a solution, how to provide an unix socket inside chrootted ...
eRIZ's user avatar
  • 220
1 vote
1 answer
1k views

backup files to a remote server with multiple versions using rsync hardlink option

To use rsync hard link option to backup files remotely so that remote backup server could keep multiple versions of the backups, both the link-dest directory and the target directory have to be on the ...
Purres's user avatar
  • 239
1 vote
0 answers
482 views

How to secure tmp directory from hard link attacks when host doesn't allow partitioning

I'm a new sysadmin in the making, have learned that I need to have /tmp and /home directories on separate partitions in order to prevent possibilities of privilege escalation through hard links based ...
Vishal's user avatar
  • 11
1 vote
1 answer
454 views

Is there a way to create a 'trackable' link (~hard link) to a folder on Windows (Windows XP in particular)?

Lets suppose that there are: a folder and a junction point or a symlink to that folder When the original folder is moved to a new location, both the junction point and the symlink fail (point to an ...
colemik's user avatar
  • 759
0 votes
2 answers
174 views

How does vzdump treats hard links pointing out of the virtual machine?

I have an OpenVZ container containing some hard links pointing to the host file system. For example, I have run on the host ln /root/file /var/lib/vz/private/101/root/link Now I'm asking myself: if ...
lucaferrario's user avatar
6 votes
3 answers
4k views

How does logrotate interact with hard linked files?

I have a service which insists on keeping it's log files in terrible locations. After all efforts to change where it keeps them failed, my next idea was to create hardlinks to those files somewhere ...
Scivitri's user avatar
  • 171
2 votes
2 answers
2k views

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-...
Francis Martens's user avatar
0 votes
1 answer
901 views

Cant remove linux ln hard links

I am using CentOS 6.3 and am logged in a root. When I create a hard link by doing this: ln /root.hdd /somedir/root.hdd That works fine, the inode shows the same between the two files and ...
Quinton Pike's user avatar
0 votes
2 answers
359 views

Daemon to create hardlinks on Linux file server which finds identical files

I have a Linux server where I only store new files or rename directories and never edit files. It contains backups from other Linux servers. Due to certain circumstances there are quite some ...
Christian's user avatar
  • 1,052
0 votes
1 answer
163 views

Hard link files within directory to reduce space usage, by "version"

I have an Ubuntu 12.04 server. Server is running rsyncd (rsync daemon), and allows an external process to rsync in files to a given path, with full control of the file structure within that given path....
Jon L.'s user avatar
  • 318
2 votes
3 answers
2k views

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's user avatar
0 votes
1 answer
516 views

Backing up an rsnapshot directory to a remote device

I have a local backup server that uses rsnapshot with hard links that contains about 10TBs of information which add about 4 to 5GBs per day. It's works great. I've been requested to set up and ...
GregS's user avatar
  • 1
9 votes
2 answers
2k views

Break all hardlinks within a folder

I have a folder which contains a certain number of files which have hard links (in the same folder or somewhere else), and I want to de-hardlink these files, so they become independant, and changes to ...
Suzanne Soy's user avatar
1 vote
1 answer
79 views

Speeding up directory creation / file linking

I'm using rsnapshot for backups. Currently that means every time an update runs (even without any data difference) I get a copy of ~100M of only the directory structure + inode list. The files are ...
viraptor's user avatar
  • 1,306
2 votes
2 answers
2k views

bind (hardlink) one directory to many places

I need to "bind" one directory to many chrooted places. I know that I can do "mount -o bind", but this requires special processing on startup each time (run the mount). Is there a way to do it on the ...
PoltoS's user avatar
  • 141
0 votes
2 answers
121 views

What happens if hardlinks are not preserved?

I evaluate backup solution for common linux servers. What happens if hard links are not preserved? The only draw back I see: After the restore some MB more space is required. But this is no problem ...
guettli's user avatar
  • 3,763
4 votes
1 answer
471 views

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 ...
Ben2209's user avatar
  • 153
1 vote
1 answer
1k views

directory of hardlinks on NTFS appears to be consuming more space than it should

Windows 2008 R2 and Windows 7 Ultimate both exhibit this behaviour... So I have directory structure like... YEAR\MONTH\file_x.ext, where YEAR goes back to 2007 and each MONTH directory contains ...
Sam Axe's user avatar
  • 163
48 votes
6 answers
50k views

How do I view a file's hard links in Windows?

I've found a description of hard links and junctions in Windows, however I'd like to know ,from the Windows UI or command prompt, how I can view the hard links of a particular file or folder?
John K's user avatar
  • 1,763
10 votes
3 answers
26k views

how to create symbolic link (ln) between two partitions

I have two partitions on my Ubuntu 10.04.3 server. partition 1: /mnt/storage/ partition 2: /var/www/myweb/ now when i run the following command $ ln /mnt/storage/sourcefile.txt /var/www/myweb/...
Alaa Alomari's user avatar