Questions tagged [hard-link]

A hard link is file system entry that associates a name with another file on a file system.

Filter by
Sorted by
Tagged with
0
votes
0answers
46 views

How do I derive multiple bash variables from a folder path and filenames?

This is about the twentieth time I've tried to write this post but it always becomes a behemoth... so I'm going to try and keep it short. Basically what I want to do is push my noobie skills to the ...
0
votes
2answers
21 views

du counts hard links only once but hard links have the same size as the first hard link?

I have a large directory structure that has many hard links from the first hard link which lives in a different directory structure. For example dir1 has the following structure : [dir1]$ tree . ├── ...
3
votes
3answers
230 views

Why didn't inode change anymore with a hard link

I use Vim 8.2 to edit my files in my Ubuntu 18.04. When I open a file, do some changes and quit with Vim, the inode number of this file will be changed. As my understanding, it's because the backup ...
0
votes
0answers
13 views

optimal disk configuration for a disk with only inodes and hardlinks

I would like to use the filesystem as a reference tracker. I work on a system with lots of jobs where each job has a directory and every once in a while we clean up old job directories, in the job ...
1
vote
2answers
148 views

Finding duplicate files using bash script

How do you write a bash one-liner that will find binary files with identical contents, permissions, and owner on the same ext4 file-system, from the current working directory recursively, and replace ...
0
votes
1answer
42 views

How to find evey softlink to a directory?

Take /etc dir as example. On my system it has 144 links. And as dir's can't have hardlinks (this is my understanding), the number 144 should refer to softlinks (1 original + 143 softlinks). $ ll -i ...
7
votes
2answers
2k views

How to effectively trace hardlink in Linux?

Softlinks are easily traceable to the original file with readlink etc... but I am having a hard time tracing hardlinks to the original file. $ ll -i /usr/bin/bash /bin/bash 1310813 -rwxr-xr-x 1 ...
0
votes
0answers
43 views

In an NTFS filesystem, does hardlink count, as reported by ls and stat, include other link types as well as hardlinks

Does NTFS count other link types with the same counter it uses for hardlinks? Or does Linux include other link types when it calculates hardlink count in an NTFS filesystem? I have an NTFS filesystem ...
0
votes
2answers
33 views

Linking and Copying

I have a few questions regarding links in UNIX Can I say Soft links in UNIX are analogous to shortcuts in windows? Difference between copying and hard-linking? Can anyone give me a use-case where I ...
1
vote
0answers
15 views

Using link-dest thwarted by permissions

I'm trying to do a weekly archive of a source folder using the previous week as a source for link-dest. However, the actual source folder has one set of permissions (on files) that differ from what ...
1
vote
2answers
139 views

Unix: “..” doesn't point to parent — how is this possible?

I recently ran into the following problem on a Solaris 11 system I do development on: Somehow, a few directories had their parent pointer (..) pointing to a different directory from the parent. Let'...
0
votes
1answer
27 views

Move daily backup directories (made by rsync) to another directory in the same partition

I have a daily rsync script backing up my data on an external hard drive at /mnt/X (root of hard drive). I am using --link-dest to use hard links and avoid duplicating data. I need to move all my ...
1
vote
1answer
96 views

Understanding hard links

I created a file in home directory. touch demo echo "This is demo" > demo Now I created a hard link in /tmp ln /home/leo/demo demoLink Now when checking the inode using ls -ltri demoLink It ...
0
votes
1answer
54 views

Enable symbolic link from other user

I'm trying to get the symbolic link from other user. My file is located in /home/serviceA/logs/a.txt And I want to create a symbolic link to /home/centos/logs/a.txt. Here is my command I ran as root ...
0
votes
1answer
44 views

Invalid cross-device linked. Multiple shares from the same NAS

I have a NAS devices, and I've mounted 2 shared folders from this one device. QNAP Ubuntu 18.04 fstab config: //192.168.0.10/Media /media/QNAP_Media cifs credentials=/home/user/.smbcredentials,...
2
votes
0answers
42 views

Looking for a convenient way to create hard links

I'm looking for a convenient way to create hard links. Sort of like a drag and drop method. I was looking for such a feature in Midnight Commander but I couldn't find it. If there's a CLI-based file ...
0
votes
1answer
90 views

Can every file really own at least 2 names (and thus 2 hard links)?

This page on inodes has been exceptional help in grasping the surface-level concept of file systems. On the same page, the author has inserted this snippet demonstrating that each file or directory ...
1
vote
4answers
228 views

Hardlink that “split” when a file changes

Is it possible (in classical ext4, and/or in any other filesystem) to create two files that point to the same content, such that if one file is modified, the content is duplicated and the two files ...
0
votes
1answer
98 views

Working Syntax for Rsync Copy of a set of 2 or more Hard-linked Folder Trees while maintaining this specific archive structure?

Working Syntax for Rsync Copy of a set of 2 or more Hard-linked Folder Trees while maintaining this specific archive structure? PS: Would this be a better fit in SO or SU SE? Template of Current/ ...
1
vote
0answers
99 views

How to force tar cf to have reproducable results?

Preface: We have a complex build process and discovered it's working on one system and failing on another (unfortunally/Murphy it worked on the Jenkins build server, so the problem remained ...
7
votes
4answers
565 views

Properly unlinking hard links

I have a script that goes like this ln /myfile /dev/${uniquename}/myfile I want to remove the link of /dev/somename/myfile to decrease the link count. How do I do this?
0
votes
0answers
270 views

Cannot rm broken NTFS link

I'm trying to use an old windows NTFS drive as extra storage on a raspberry pi. I tried to delete everything on it, but came across a problem where I can't remove two broken links. I can format the ...
1
vote
1answer
72 views

Find (and delete) all files with hard link count = 1

I'm having a tough time trying to reclaim some unused disk space on one of my macOS 10.13 partitions. Thanks to GrandPerspective, I think I found out that every time I delete some items in Photos for ...
0
votes
1answer
80 views

Link files and directories, in target directory, with cross-device links

I have a user account at my local library (they use openslx), in which I can store files. My actual home folder is "mounted" (I'm not sure how) in /home/[my_userID]/PERSISTENT instead of /home/[...
0
votes
1answer
536 views

Hard links with MergerFS

If someone uses the command "cp -alr" on a directory located in a non-path preserving merged pool will it always create a directory on the same disk with all of its contents as hard links? For ...
1
vote
1answer
106 views

Safely remove a symlink or hardlink

Does using rm on a symlink or a hard-link remove the source in addition to the link? Is there a good way to delete a hard-link or a symlink without deleting the source? And if there is a good way ...
0
votes
1answer
693 views

Difference between file descriptor and soft/hard link

If soft link and hard link are pointer to a file. And file descriptor is a file handle pointing to an open file. Then what exact difference is between the two if both of them are a kind of pointer ...
1
vote
1answer
266 views

What happens when you copy a hardlink?

Imagine I have a file something/a.txt, which I hardlink from b.txt. Now, if I cp b.txt c.txt, is c.txt a hard link to a.txt, or is it a copy of the contents of a.txt?
-1
votes
1answer
115 views

A command to know if some file are “only” an hard link and “not” a symlink [duplicate]

I need a command for an if condition to know if 'file_name' is an hard link (not symlink). Thanks
1
vote
2answers
190 views

What to do when hard link is lost because of my text editor

So, I have a file, for this instance we shall call it $HOME/Documents/hello.txt. I will write some text inside it: Hello, welcome to my text file And I will hard-link this file here: $HOME/Documents/...
1
vote
2answers
341 views

How can you move hardlinks to another disk

If we have a file on a disk and create a hard link pointing to it then we have two references to the same data. If one link gets deleted it does not affect the other link as it is directly pointing ...
2
votes
1answer
519 views

Overlay storage driver internals

A follow-up from this question. My further reading on Docker storage drivers revealed that the overlay driver merges all the image layers into lower layers using a hard link implementation which ...
20
votes
2answers
2k views

How to create a hard link to an inode (ext4)?

If I know the index node (inode) of a file, but I don't know its path (or any of its paths), is it possible to create a hard link to that inode directly? I could find the file using sudo find / -inum ...
1
vote
0answers
136 views

Rsnapshot made my external disk run out of space

I have Rsnapshot doing incremental backups from Client1 to Server1 (RAID 5) within folder "BACKUP". On Server 1, tonight, I copied the "BACKUP"to an external disk for the first time using the command ...
1
vote
1answer
1k views

Why don't FAT filesystems support links? [closed]

FAT filesystems represent files via linked lists of clusters (linked file allocation). They have a region on disk for one or more tables (File Allocation Table) which have as many entries as ...
1
vote
1answer
71 views

Determine extra size of hard link tree

It is relatively common to use a "hard link tree" to create a second backup of a folder that is effectively just a copy of the files that have changed since the original backup. For example, rsync ...
-2
votes
1answer
195 views

creating test1 and test2 files in /var directory in Linux, [closed]

I need to create test1 and test2 files in /var directory in Linux , and creating Hard link for test1 file and soft link for test2 file in /tmp
1
vote
1answer
2k views

unlink delete files which are not links [duplicate]

I created a hard link $ ln hours.sh hours_link test it $ ls -l hours* -rw-r--r-- 2 me staff 653 Apr 12 2018 hours.sh -rw-r--r-- 2 me staff 653 Apr 12 2018 hours_link remove it with unlink $ ...
1
vote
3answers
2k views

How do you count the total number of hard links within a directory?

I've been trying to use the -ls and find commands to total the number of hard link occurrences within a directory. Is there a simple way to accomplish this beyond physically counting all of the link ...
4
votes
3answers
174 views

unique contribution of folder to disk usage

I have a backup containing folders for daily snapshots. To save space, identical files in different snapshots are deduplicated via hard links (generated by rsync). When I'm running out of space, one ...
1
vote
1answer
219 views

Using clamav efficiently when timeshift snapshots are present

I am searching for a simple way to perform a full system scan using clamav on a machine that also has Timeshift based snapshooting enabled. As suggested by this answer on the Ubuntu site, I was using ...
4
votes
1answer
517 views

Atomically write a file without changing inodes (preserve hard link)

The normal way to safely, atomically write a file X on Unix is: Write the new file contents to a temporary file Y. rename(2) Y to X In two steps it appears that we have done nothing but change X "...
0
votes
1answer
58 views

what is the right approach to copy folder content that include links

we have the following folders / links /files under /usr/hdp/2.6.0.3-8/zookeeper folder -rw-r--r--. 1 root root 794542 Apr 1 2017 zookeeper-3.4.6.2.6.0.3-8.jar drwxr-xr-x. 6 root root 4096 Mar 28 ...
1
vote
0answers
63 views

Some questions about Hard-links, and backups

Recently I accidentally whipped out a directory with important stuff, and now I'm starting to think about the best ways to have backups, a remote copy It's already in place but I was thinking, about ...
-3
votes
1answer
120 views

hard-link inode behaviour

bash: ~/Desktop $ mkdir DIR bash: ~/Desktop $ cd DIR bash: ~/Desktop/DIR $ echo 000_111 > fileA bash: ~/Desktop/DIR $ ln fileA fileB bash: ~/Desktop/DIR $ cat fileA fileB 000_111 ...
0
votes
1answer
296 views

df du hardlinks and space reclaimation

I am really confused on how to build an understanding around hardlinks. I work with a DB hosted on Linux. The Db in order to take backups creates hardlinks to data files in a different directory. ...
-1
votes
1answer
603 views

Send program's serial output to pseudo-terminal used by serial sniffer such as jpnevulator [duplicate]

I am running an application that communicates through a real serial port e.g. /dev/ttyS0 to a remote device. I can configure this application to use /dev/ttyS0, /dev/ttyS1, etc., by passing the ...
1
vote
2answers
326 views

How many times is the disk accessed?

This is regarding generic UFS. From what I understand when an absolute path is given (eg: /home/userU/file.txt) the disk is accessed for each directory and the file. Hence in this case the disk is ...
4
votes
1answer
2k views

How do hard links, symbolic links, and ACL folder permissions interact?

This one was a bit tricky for me to realize, but I came across a very weird behavior involving ACL extended file permissions and hard/symbolic links. I'll do my best to keep my question short and to ...
2
votes
0answers
133 views

HFS+ on fedora, many broken directory hard link [closed]

There is a hard disk. In one directory there are around 1000 directories, and every each one hard linked to other location in the same hard. the problem is that in fedora 35 of them I could open, the ...

1
2 3 4 5