All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
1answer
71 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 ...
0
votes
1answer
95 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
84 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
51 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
100 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
0
votes
1answer
48 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 ...
2
votes
0answers
84 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
6k 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
0answers
775 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 ...
5
votes
2answers
387 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 ...
2
votes
3answers
1k views

Why can I not hardlink to a file I don't own even though I can move it?

Example script: #!/bin/sh -e sudo useradd -m user_a sudo useradd -m user_b -g user_a sudo chmod g+w /home/user_a set +e sudo su user_a <<EOF cd umask 027 >> file_a >> file_b >&...
0
votes
1answer
32 views

Why soft links from standard folders?

My observation is, most of the python files sitting in some standard locations like site-packages are symbolic links to actual file name(sitting in non-standard folder) pointing to inode. ...
0
votes
2answers
311 views

How to claim disk space by removing all the files and hard links?

I've been trying for hours to figure this out but cant seems to do it My question Is I have a file name easy and there's 4 different sub directories in it now what I have to do is delete ...
0
votes
2answers
155 views

Simfs hardlinks whereabouts

I got a weird hardlink at centos 6.5 vps server. It's man made, I assume, but I'm not the one who did it. df tells some info. [root@root]# df Filesystem 1K-blocks Used Available Use% ...
29
votes
4answers
3k views

How to unlink (remove) the special hardlink “.” created for a folder?

On Linux, when you a create folder, it automatically creates two hard links to the corresponding inode. One which is the folder you asked to create, the other being the . special folder this folder. ...
2
votes
1answer
105 views

handy script to reduce hardlink count?

I'm transitioning a large fileset from a filesystem with a high _PC_LINK_MAX (maximum number of hardlinks per inode) to a lower one. In particular, I'm messing about with Amazon EFS, which has a ...
0
votes
2answers
986 views

Are hard links for directories possible on ext2/3/4 filesystems?

I've read that the command (and perhaps the system call, too) for creating hard links will not let one create hard links for directories. I also understand that hard links can pose problems for path-...
2
votes
1answer
173 views

Deleting hardlink with rm -rfv deletes the original?

I was reading up on similar questions on here about what happens when you delete a hardlink to a file and the majority of the answers I was getting were that the hardlink is deleted but the original ...
10
votes
2answers
400 views

Are there any filesystems for which `ln -d` succeeds?

From the manpage for ln: -d, -F, --directory allow the superuser to attempt to hard link directories (note: will probably fail due to system restrictions, even for the superuser) Are there any ...
16
votes
2answers
19k views

Hard-link creation - Permissions?

Which permissions affect hard-link creation? Does file ownership itself matters? Suppose user alice wants to create a hard-link to the file target.txt in a directory target-dir. Which permissions ...
3
votes
1answer
158 views

Why can't a UID 0 process hardlink to SUID files in a user namespace?

Consider the following transcript of a user-namespaced shell running with root privileges (UID 0 within the namespace, unprivileged outside): # cat /proc/$$/status | grep CapEff CapEff: ...
37
votes
1answer
37k views

How to find all hard links to a given file? [duplicate]

How can we find all hard links to a given file? I.e., find all other hard links to the same file, given a hard link? Does filesystem keep track of the hard links to a file? The inode of a file only ...
6
votes
2answers
402 views

Several hard-links with different metadata in Linux using Ext4

Is it possible for Ext4 file systems (or maybe another one understood by Linux) to assign different metadata (like modification time, owner, access rights) to several hard-links that refer to the same ...
5
votes
1answer
378 views

“hard-linking” parts of a big file in which only a small part has changed

I use rsync to make backups: rsync -a --link-dest=PATHTO/$PREVIOUSBACKUP $SOURCE $CURRENTBACKUP This way I save space due to using hard links. The problem appears when I need to backup a huge file ...
5
votes
2answers
1k views

Linux: How does hard-linking to a directory work?

I'm aware that Linux does not allow hard-linking to a directory. I read somewhere, that this is to prevent unintentional loops (or graphs, instead of the more desirable tree structure) in the file-...
3
votes
1answer
419 views

setgid binary doesn't have permission, mount's right, I'm missing something, but what, please?

I've checked the manpages, the mount, the permissions ... (edit: combined history into one sequence as requested. Starting to seem a not-simple problem. Nothing new since last edit, just bundled up ...
13
votes
2answers
11k views

Why do hard links seem to take the same space as the originals?

Thanks to some good Q&A around here and this page, I now understand links. I see hard links refer the same inode by a different name, and copies are different "nodes, with different names. Plus ...
4
votes
1answer
441 views

Files have the same inode but they don't link to each other

I have a bash script in two places and I can't remember how I created them. they have the same inode but none of them seem to link to another. is there a hard link but should not Links count for that ...
3
votes
1answer
2k views

How can I delete a hardlink to a directory?

Before I get 100s of answers that tell me it is impossible to hardlink directories in linux: yes, I know that. The file in question appeared in lost+fount after I checked the filesystem with e2fsck (...
9
votes
1answer
1k views

Finding all the hard-links of a file without traversing the file system

I have seen in this page that inodes have a link counter to know how many files (read: "directory entry") point to this inode. Is there a way to know which directories contain such entries without ...
0
votes
1answer
425 views

How hardlink and softlink works in background?

I am looking for an explanation of the following: what happens in Linux when we create soft link and hardlink how are they accessible why do symlinks always display 777 permissions
3
votes
0answers
1k views

Multiple Linux or Unix Distributions, Same Home Partition or Data?

To avoid conflicts I have always installed multiple Linux and Unix distributions each with it's own home partion or directory, and in the era of 3TB hard drives this is often very practical; I also do ...