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
0answers
20 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, ...
0
votes
0answers
57 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:/...
2
votes
1answer
35 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. ...
0
votes
1answer
95 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 ...
2
votes
0answers
86 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 ...
13
votes
1answer
581 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 ...
-1
votes
1answer
255 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 ...
1
vote
0answers
939 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 ...
0
votes
3answers
51 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 ...
2
votes
1answer
93 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 ...
0
votes
0answers
335 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?
0
votes
1answer
317 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 ...
2
votes
2answers
1k 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 ...
0
votes
1answer
43 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/...
2
votes
3answers
196 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 -...
3
votes
1answer
1k 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 ...
5
votes
0answers
392 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 ...
0
votes
2answers
566 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 ...
6
votes
1answer
4k 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 ...
1
vote
1answer
873 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 ...
1
vote
0answers
343 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 ...
1
vote
1answer
242 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 ...
0
votes
2answers
146 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 ...
5
votes
3answers
2k 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 ...
1
vote
2answers
811 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-...
0
votes
1answer
795 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 ...
0
votes
2answers
305 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 ...
0
votes
1answer
159 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....
2
votes
3answers
1k 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?
0
votes
1answer
282 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 ...
10
votes
2answers
1k 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 ...
1
vote
1answer
66 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 ...
1
vote
2answers
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 ...
0
votes
2answers
78 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 ...
4
votes
1answer
400 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 ...
0
votes
1answer
699 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 ...
34
votes
6answers
32k 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?
9
votes
3answers
18k 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/...
11
votes
3answers
2k views

How to mirror filesystems with millions of hardlinks?

We have one big problem at the moment: We need to mirror a filesystem for one of our customers. Thats usual not really a problem, but here it is: On this filesystem there is one folder with millions ...
6
votes
1answer
227 views

Linux hardlink confusion

I am confused with Linux hard link, I created a hardlink with this command on my Ubuntu box, ln f1 f2 So f2 should be a hardlink of f1, but why I changed f2 with emacs and saved f2, f1 didn't ...
0
votes
1answer
1k views

How do i hardlink /run to /var/run on debian? (And should i be doing it?)

I'm trying to copy the root file system of a Debian unstable system. I get the following warnings when i do this: gw:/# cp -xar / /mnt/1.tmp/ cp: will not create hard link `/mnt/1.tmp/var/run' to ...
4
votes
2answers
2k views

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 ...
1
vote
2answers
147 views

Hardlink files not the same

I created a hardlink of a file as follows: ln /path/to/source/file1 /path/to/target/file2 Using md5sum, the two files are identical. After a while, the source file has been modified by another ...
23
votes
8answers
20k views

How can I use rsync to duplicate a directory tree, creating hardlinks to files?

From time to time, I have to perform several large migration changes on data files on my server, and I'm looking for a good way to do this. I was thinking about using rsync to duplicate my directory ...
6
votes
3answers
4k views

rsync with --hard-links freezes

I have a large directory called servers, which contains many hard-links made by rsnapshot. That means that the structure is more or less like: ./servers ./servers/daily.0 ./servers/daily.0/file1 ./...
2
votes
4answers
411 views

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 ...
14
votes
3answers
4k views

Is there a way to create a copy-on-write copy of a directory?

I'm thinking of a situation where I would have something that creates a copy of a directory, tweaks a few files, and then does some processing on the result. This wold be done fairly often, maybe a ...
3
votes
1answer
743 views

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 ...
4
votes
7answers
2k views

Linux: Best-practices for Hard Linking?

I've used hard links in the past, but they seem to make a bit of a mess of things... When is the proper time to use Hard links? What are the best practices for when and where to use hard linking? ...
3
votes
1answer
2k views

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 ...