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
1answer
25 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
23 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/....
2
votes
1answer
34 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
82 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
3answers
92 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
63 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
57 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
438 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
40 views

BSD tar xPf won't extract hardlinked files through symlinked directory

On MacOS 10.11.6, /usr/bin/tar is "bsdtar 2.8.3 - libarchive 2.8.3". The -P option allows me to extract a tar file through a symlink. That is, if foo1 is a symlink to foo2, and the tar file stores ...
0
votes
0answers
72 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
50 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
36 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
200 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
61 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
276 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 ...
0
votes
1answer
131 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?
0
votes
1answer
49 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
1answer
107 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
115 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
368 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 ...
18
votes
2answers
1k 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
89 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
516 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
42 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
122 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
1k 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
924 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
123 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
134 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
321 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
51 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
50 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
112 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
228 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
460 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
82 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 ...
3
votes
1answer
1k 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
100 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 ...
11
votes
3answers
9k views

Why I can't create a hard link from device file in other than /dev directory?

When I wanted to create a hard link in my /home directory in root mode, Linux showed the following error message: ln: failed to create hard link ‘my_sdb’ => ‘/dev/sda1’: Invalid cross-device link ...
1
vote
1answer
281 views

Create hard link if possible, else use symlink

I am trying to write a shell script to create link for file from my dotfiles repo to my home folder. I want to use hard link if possible because it cannot be broken when moving it to somewhere in ...
0
votes
2answers
136 views

Why are there lots of hard links in /usr [closed]

I've read this link, now I simply want to know why there are lots of hard link in /usr. For example, in my Ubuntu server, installed git, I found the command git here: /usr/bin/git. I execute ls -l /...
1
vote
1answer
298 views

Linux - Directory with zero link count (Rancher container)

I have a permission error in a Rancher container's shell when accessing certain directory, but the permissions are correctly set. Then I noticed that the link count for said directory is zero, as ...
2
votes
0answers
813 views

Incremental backups - rsync with hard links, or rsync to zfs with snapshots?

I need to set up a backup server to pull data from on-site linux servers. The server will be running Ubuntu 16.04. A requirement is to be able to access backups of files which have been subsequently ...
1
vote
0answers
934 views

Is /usr/bin/bash the same as /bin/bash (CentOS 7) [duplicate]

Are /usr/bin/bash and /bin/bash the same thing? They seem to have the same inode number and attributes: [vagrant@tmp-ansible-test-vm ip_lookup]$ ls -il /bin/bash /usr/bin/bash 1574356 -rwxr-xr-x. 1 ...
2
votes
1answer
218 views

Paths in ln with hard links and soft links

How does the relative paths work in ln (-s or not)? For example if I type ln -s foo bar/banana.txt what does this mean? What is foo relative to? Because it doesn't seem to be relative to the current ...
0
votes
1answer
295 views

pax command for incremental backup with hard links similar to rsync

I discovered the pax command recently, and was amazed at how efficient it is when copying locally from one SSD to another, for instance. For local backup, I'm contemplating replacing a rsync ...
5
votes
2answers
394 views

Calling a function by a second name (homework)

I'm writing a function called restore that will copy a file from a backup directory to the current directory. I now need to create a hard link to restore so that it can be called as purge. How would I ...
18
votes
2answers
4k views

cp behaves weirdly when . (dot) or .. (dot dot) are the source directory

This answer reveals that one can copy all files - including hidden ones - from directory src into directory dest like so: mkdir dest cp -r src/. dest There is no explanation in the answer or its ...
2
votes
1answer
549 views

Simulating a hard-link to a directory [duplicate]

I have a kind of problem. I am trying to hard-link all my dotfiles [files that customize certain apps] in one folder for ease of use, called ~/dotfiles/ , but multiple programs that I have, have ...
0
votes
2answers
2k views

Rm hardlink without removing file/directory itself

Say I create a hardlink with ln x y. Is there a way to remove the link at y without removing the file at x, after I create the link? It looks like I did a rm -rf on y and it deleted x as well, would ...

1
2 3 4 5