inode

Why can't hard links reference files on other filesystems?

Why can't hard links reference files on other filesystems? I’m aware that this article exists: Why are hard links only valid within the same filesystem? But it unfortunately didn’t click with me. https://www.kernel.org/doc/html/latest/filesystems/ext4/directory.html I’m reading operating system concepts by Galvin and found some great beneficial resources like linux kernel documentation. There can be many directory …

Total answers: 5

How does `ls` find hard links?

How does `ls` find hard links? Setup The following sequence of commands is setup for my question. root@cd330f76096d:/# cd root@cd330f76096d:~# ls root@cd330f76096d:~# mkdir -p my_dir/my_subdir root@cd330f76096d:~# ls -hAil total 12K 6175969 -rw-r–r– 1 root root 3.1K Oct 15 2021 .bashrc 6175970 -rw-r–r– 1 root root 161 Jul 9 2019 .profile 7382820 drwxr-xr-x 3 root root …

Total answers: 1

open a file by inode number

open a file by inode number Is there any way to find exactly the blocks allocated to a inode, and view that file? I don’t care if I have to be on a live cd, but i need to do this for example: cat verylongsentice > a ls -i a 101010 a ln a /some/random/path …

Total answers: 1

Is '..' really a hard link?

Is '..' really a hard link? This is a bit of a theoretical question, but it’s important to use proper names for things. In UNIX/Linux file systems, .. points to the parent directory. However, we know that hard links cannot point to directories, because that has the potential to break the acyclic graph structure of …

Total answers: 5

Does Linux support invoking a program directly via its inode number?

Does Linux support invoking a program directly via its inode number? I’m asking because string comparisons are slow, but indexing is fast, and a lot of scripts I write are in bash, which to my knowledge performs a full string lookup for every executable call. All those ls’s and grep’s would be a little bit …

Total answers: 4

Ext4 "unused inodes" "free inodes" diffrence?

Ext4 "unused inodes" "free inodes" diffrence? When I use the dumpe2fs command to look at the Block Group of the ext4 filesystem, I see "free inodes" and "unused inodes". I want to know the difference between them ? Why do they have different values in Group 0 ? Group 0: (Blocks 0-32767) [ITABLE_ZEROED] Checksum 0xd1a1, …

Total answers: 1

linux + list inode information show 100% used

linux + list inode information show 100% used we notices about some of our RHEL machines that inode information show 100% the following for example show that /dev/sdb is 100% df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sdc 2621440 231603 2389837 9% /data/sdc /dev/sdd 2621440 2616856 4584 100% /data/sdd /dev/sde 2621440 2613251 8189 …

Total answers: 1

Changing file permissions in inodes while a user has the file open

Changing file permissions in inodes while a user has the file open According to this SO question, when we open a file to read it we only check permissions once when we open it. And if we change the permissions of the file and say the user is no longer allowed to read from the …

Total answers: 1

How Linux kernel sees the filesystems

How Linux kernel sees the filesystems I’m still confused about the concept of kernel and filesystem. Filesystems contain a table of inodes used to retrieve the different files and directories in different memories. Is this inode table part of the kernel? I mean, is the inode table updated when the kernel mounts another filesystem? Or …

Total answers: 2

Reset ext4 filesystem without changing the filesystem UUID

Reset ext4 filesystem without changing the filesystem UUID I have a filesystem with many small files that I erase regularly (the files are a cache that can easily be regenerated). It’s much faster to simply create a new filesystem rather than run rm -rf or rsync to delete all the files (i.e. Efficiently delete large …

Total answers: 6

How to copy a file by using its inode number?

How to copy a file by using its inode number? This problem is related to Samba and inodes are not necessary. I have a problem handling a certain file that has some special characters in it. If I search it by its inode it will list the file: $ find . -inum 90505400 -exec ls …

Total answers: 2

debugfs not working | file not found by ext2_lookup

debugfs not working | file not found by ext2_lookup $sudo blkid /dev/sda1: UUID="F959-61DE" TYPE="vfat" PARTUUID="950b18a0-1501-48b4-92ef-ba1dd15aaf21" /dev/sda2: UUID="6dfcfc23-b076-4eeb-8fba-a1261b4ea399" TYPE="ext4" PARTUUID="ddc69ee8-40b0-49c9-9dcb-0b9064caca7d" /dev/sda3: UUID="fec0af18-d28e-4f2a-acb7-6380ddee3dc2" TYPE="ext4" PARTUUID="e19628dc-c04a-4c9d-a3c6-469511e89480" /dev/sda4: UUID="a6f7669b-6e86-432a-b91c-f39780c849ac" TYPE="swap" PARTUUID="e45cf647-3d78-4fea-a950-022a3ae9b4e0" /dev/sda5: UUID="5a75937f-8a83-44a9-b5c5-502b7e3884f2" TYPE="ext4" PARTUUID="3e086aff-105f-48b3-a384-1eb1d18c6fb3" /dev/sda6: UUID="04460cd2-a1bb-4a3e-94df-1ad10080f356" TYPE="ext4" PARTUUID="d37fdea8-a386-4f6f-8016-fa2764a71b60" $pwd /home/milad $touch a $ls -i a 3935203 a $sudo /sbin/debugfs/ -R ‘stat 3935203’ /dev/sda6 debugfs 1.44.5 (15-Dec-2018) 3935203: File …

Total answers: 2

Same file name different INODES

Same file name different INODES I recently discovered on a machine with RHEL6: ls -lbi 917921 -rw-r—–. 1 alex pivotal 5245 Dec 17 20:36 application.yml 917922 -rw-r—–. 1 alex pivotal 2972 Dec 17 20:36 application11.yml 917939 -rw-r—–. 1 alex pivotal 3047 Dec 17 20:36 application11.yml 917932 -rw-r—–. 1 alex pivotal 2197 Dec 17 20:36 applicationall.yml …

Total answers: 2

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

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 “in-place”. It is protected against …

Total answers: 1

Can two files on two separate filesystems share the same inode number?

Can two files on two separate filesystems share the same inode number? If I run a command like this one: find / -inum 12582925 Is there a chance that this will list two files on separate mounted filesystems (from separate partitions) that happen to have been assigned the same number? Is the inode number unique …

Total answers: 2

What are the final 3 bits in the UNIX permission mode bits?

What are the final 3 bits in the UNIX permission mode bits? I understand there are 12 permission bits of which there are 3 groups of 3 bits for each of user, group, and others, which are RWX respectively. RW are read and write, but for X is search for directories and execute for files. …

Total answers: 2