Questions tagged [inode]

For question pertaining to the inode (index node), a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Use this tag for questions about the inode data structure itself or questions about issues arising from querying or managing inodes in the scope of a filesystem.

Filter by
Sorted by
Tagged with
0 votes
1 answer
17 views

How does "Inodes per group" and "lazy_itable_init" flag relate to the "Inode count" value in an ext4 filesystem?

I am trying to root cause a customer case where 2 Identical drives, formatted with the same command, led to a difference of ~55GB in total disk space due to additional Inode overhead. I want to ...
user avatar
  • 19
0 votes
1 answer
18 views

What's the difference between structures "cdev" and "inode" in the context of device driver programming?

I am currently studying device drivers in an operating systems course and am getting confused regarding the difference between the "inode" structs and "cdev" structs. Could someone ...
user avatar
  • 587
1 vote
0 answers
36 views

ls displays no files even though folder contains files

This question is actually derived from a problem I have with a python library which deletes a file tree and then recreates the content, but on attempt of execution of a file inside the directory, the ...
user avatar
3 votes
1 answer
99 views

mv on ext4 is doing copy-and-remove instead of inode relocation

I am under the belief that if you mv a file from an ext4 partition to itself, this is done instantly in constant time by updating directory entries and keeping the inode the same. Instead, sometimes I ...
user avatar
  • 751
1 vote
0 answers
17 views

Is there a system / btrfs tool whick will provide me with the record location for a specific inode number in a btrfs volume?

I want to find the location of the record data for a specific inode. Is there a system tool or a btrfs tool which will provide me with at least it's bloc number ?
user avatar
  • 234
0 votes
0 answers
32 views

Restore damaged folder inodes in ddrescue image

I restored my failing external ntfs hdd using ddrescue, around 80% of the data is restored, the rest seems to be bad blocks. I can mount the created image file and ubuntu detects it and shows the ...
user avatar
  • 1
0 votes
0 answers
138 views

what are the causes for "checksum does not match inode" HD problem, even if it says the inode check passed?

Root became RO after some minutes using the PC. On reboot it required manual fsck. Then this problem happened: it said the inode check passed fine ok, but said this problem: "checksum does not ...
user avatar
14 votes
6 answers
1k views

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 ...
user avatar
6 votes
2 answers
957 views

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: $ ...
user avatar
  • 295
1 vote
0 answers
42 views

inode based file system, What is the maximum size of a file in the file system

could someone explain how to tackle this questions? 1. **What is the maximum size of a file that could be handled by single indirect and double indirect?** Block size is 2K Address size is 4 Bytes 12 ...
user avatar
0 votes
1 answer
22 views

Changing rights and owner in one command to safe resources

I have a backup script with the following function: function change_rights() { chown -R ${OWNER}:${GROUP} ${DIR} find ${DIR} -type f -exec chmod 0640 {} \; find ${DIR} -type d -exec chmod ...
user avatar
  • 2,281
1 vote
1 answer
128 views

ncdu - Rank by File-Count instead of Size

I like the navigation and features of ncdu, but instead of ranking folders by size, I want to rank them by file-count. For example, folders containing more files are listed first, and you can navigate ...
user avatar
  • 4,311
0 votes
1 answer
99 views

prevent inode reuse

We are using Logstash to ingest our logs and we are facing some issues due inodes being reused. We tried all possible options on Logstash side so we are exploring the OS side. As far as I can see, if ...
user avatar
1 vote
1 answer
88 views

What‘s different between inode->i_rwsem and i_flctx?

When I trace the function graph when calling write(), I find that within function ext4_file_write_iter() it locks the inode->i_rwsem by calling inode_lock(inode) at the beginning. After that call ...
user avatar
0 votes
0 answers
64 views

How to make mksquashfs with parameters

I have read Squashfs filesystem , when I look on this file with binwalk or with file I saw: Squashfs filesystem, little endian, version 4.0, compression:xz, size: 1233455 bytes, 112 inodes, blocksize:...
user avatar
0 votes
1 answer
83 views

How to minimize filesystem overhead

I have an application that uses a lot of space as essentially cache data. The more cache available the better the application performs. We're talking hundreds to thousands of TB. The application can ...
user avatar
1 vote
0 answers
45 views

How do directories with inode number 2 in different file systems know that they need to go back to the root directory?

I know that the same inode can be used in different file systems. For example, home run dev boot and / directory have inode number 2 because they are the first directories in file systems. $ ls -li ...
user avatar
  • 1,082
2 votes
0 answers
28 views

inode count via df ~5000x larger than number reported by df

I've been dealing with an issue whereby df is reporting a much larger usage of a partition mounted onto my system from a USB drive. df -h gives: /dev/sdb3 4.6T 4.2T 396G 92% /media/smb ...
user avatar
1 vote
1 answer
51 views

Why can't I symlink a preexisting file to a target file? [duplicate]

I have an example to better illustrate what I'm talking about: $ touch tas $ ln -s /etc/leviathan_pass/leviathan3 /tmp/l2/tas ln: failed to create symbolic link '/tmp/l2/tas': File exists Basically I ...
user avatar
  • 11
0 votes
0 answers
266 views

why EIO Error(Input/Output Error) appears frequently and is mostly solved with e2fsck

We have prepared a customized Linux system (ISO image with 15 GB size and all the packages we need are installed inside it) and we copy this image into different PCs with Different Intel Processors ...
user avatar
  • 115
1 vote
2 answers
46 views

Comparing two directories based on inodes

A bit of context that I think is relevant for the appropriate solution: I have a server that has two folders; one is ingest, the other is sorted. The source of the sorted folder is the ingest folder, ...
user avatar
  • 111
0 votes
1 answer
558 views

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=&...
user avatar
3 votes
0 answers
86 views

How to Open a file in the kernel using only the inode

I am currently trying to open, read, write to a specific file in the (Linux) kernel space. I know that filp_open, kernel_write functions could be used to perform the same effects as open, write in the ...
user avatar
1 vote
1 answer
71 views

No inodes information in `du -i`

Although df reports there is still plenty of space, I encountered 'No space left on device' problem while running processes that tend to create loads of small files. I thought it might be a problem of ...
user avatar
  • 111
3 votes
3 answers
474 views

How inodes numbers are assigned

Two known facts: In linux, moving a file from one location to another on the same file system doesn't change the inode (the file remains at "the same place", only the directories involved ...
user avatar
1 vote
1 answer
95 views

Why . and .. are hard links to directories while in *nix systems hard links are not allowed for directories?

I know how hard links and symlinks work and I know why hard links can't be used for directories but in this case, is it some kind of exception? For example I do: ls -al Documents total 8 drwxr-xr-x ...
user avatar
  • 181
2 votes
2 answers
290 views

what is this “first inode” reported by dumpe2fs?

using dumpe2fs on some ext4 partition, I get in the initial data, that the first inode is #11. However, if I ls -i on this disk root partition, I get that it's inode number is #2 (as expected). So... ...
user avatar
  • 234
1 vote
1 answer
181 views

Rebuilding directory tree (and/or inodes)

Problem My Armbian based Orange Pi webserver crashed (probably because of a power loss). I thought it would be fine since ext4 is more resilient and it usually has been in the past, but for some ...
user avatar
  • 143
2 votes
0 answers
416 views

Why won't fsck fix my ext4 partition?

There is a directory on one of my EXT4 partitions that an error, but fsck can't seem to fix it. # fsck -ClV -vpf /dev/mapper/enc_vols-home fsck from util-linux 2.37 [/usr/bin/fsck.ext4 (1) -- /home] ...
user avatar
  • 535
1 vote
1 answer
136 views

Reading stale file data with debugfs cat

I'm trying to read the contents of a file using the file's inode. This works fine: echo "First line" > data.txt sync sudo debugfs -R "cat <$(stat -c %i data.txt)>" /dev/...
user avatar
0 votes
0 answers
26 views

Imagick on node - Composite image with the same image on background with blur

I have this function: async function convertImage(sentenceIndex){ return new Promise((resolve, reject) => { const inputFile = ./content/${sentenceIndex}-original.png[0] const outputFile = ./content/...
user avatar
  • 11
0 votes
0 answers
50 views

External SSD mounted drive has corrupted inode used count

I have two internal SSDs (one 120GB, other 128GB), each plugged to one of these Sabrent external SSD enclosure. One of them started failing right away so I gave up on it thinking it could just be a ...
user avatar
0 votes
0 answers
45 views

Can't change inode directory in plasma

I am using KDE in Manjaro. I need to set Nautilus for my default and inode directory. I used some commands, and it didn't work. $ xdg-mime query default inode/directory org.kde.dolphin.desktop $ xdg-...
user avatar
0 votes
1 answer
100 views

How much space can I save on ext4 by replacing 1000 identical 1-byte files with 999 hard-links and 1 file?

I have an ext4 formatted disk with thousands of files that are generated automatically and are needed. A few thousand of them are only one byte long, some two bytes. All files in both groups of tiny ...
user avatar
  • 7,487
2 votes
1 answer
144 views

How to combine inotify with tail command to print last line of every modified file

I have this command this shows me when a file has been modified under a concrete directory (excluding some paths): inotifywait -m -q -r --format '%T % e %w%f' --excludei '/trash/' --timefmt '%d/%m/%Y-%...
user avatar
0 votes
0 answers
55 views

Finding a way to check whether a file has been rotated

In one of my projects which involves searching into logfiles on Linux, I need to find out how to check whether a logfile has been rotated, usually using the logrotate Linux utility. Due to legacy ...
user avatar
1 vote
0 answers
93 views

tar.unpack untar error while installing angular in Linux vm

I am installing Angular in Linux VM (3.10.0.1062) using command npm install @angular/cli@10.0.5 from Putty terminal, getting below error [host@machinename /]$ npm install @angular/cli@10.0.5 npm WARN ...
user avatar
2 votes
0 answers
25 views

How Linux system knows what files/subdirectories are under one directory [duplicate]

I'm reading the book "Linux Kernel Development", and there are some important points: inode doesn't include filename. filenames are stored in directory entry(dentry). but dentry is not ...
user avatar
  • 121
3 votes
3 answers
372 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 ...
user avatar
  • 2,809
0 votes
1 answer
69 views

Restore ENTIRE system ROOT / (CLARIFICATION)

I recently had to restore the disk with borg. So via live linux, I entered my disk file system, deleted everything (root /), and restored a backup of a specific date. Now I ask myself: do you need to ...
user avatar
0 votes
1 answer
1k views

How does rsync's --inplace option work with --backup?

I synchronize data with rsync --delete --backup --backup-dir=[some directory] -avz [source] [destination]. On the machine where rsync is executed, both [source] and [destination] directories are NFS ...
user avatar
  • 1,046
0 votes
1 answer
62 views

Contents of an inode

Is there a command that lists all the information contained in an Inode of a file/directory? Such as User ID of file, Group ID of file, Device ID, File size, Date of creation, Permission, Owner of the ...
user avatar
  • 1
4 votes
2 answers
200 views

Why my 500gb SSD has only 477056 inodes?

Filesystem Inodes IUsed IFree IUse% Mounted on udev 4030305 685 4029620 1% /dev tmpfs 4040316 1252 4039064 1% /run /dev/sdb1 477056 476282 ...
user avatar
0 votes
1 answer
119 views

Is the directory inode different then the file inode on ext-type file systems?

Im currently reading the book "How Linux Works" by Brian Ward and on chapter 4.5 it is said A directory inode contains a list of filenames and corresponding links to other inodes. This ...
user avatar
1 vote
1 answer
281 views

How does linux manage the offsets of files

After reading this post: https://stackoverflow.com/questions/14189944/unix-system-file-tables, I've basically understood how Linux manages the files. But I don't know how to manage the offsets of the ...
user avatar
  • 2,809
1 vote
1 answer
122 views

Will the kernel hold the whole file to which some process is writing

After posing this question, I'm kind of confused by the action of the linxu kernel. First of all, I know how a process writes strings into a file: a process will obtain some buffer, the buffer can be ...
user avatar
  • 2,809
0 votes
1 answer
114 views

Inodes of directories

While I was learning about inodes in ext4 file systems(or almost all Linux file systems), I found that directories also have inode entries. But I am a bit confused about a subtle aspect. Are inode ...
user avatar
0 votes
1 answer
106 views

Linux find command - find files based on inode and device?

I want to find the files with a given inode number. Using find with -inum is not entirely helpfull as its listing files with the inode number from every file system/device. How to confine this search ...
user avatar
  • 554
0 votes
1 answer
118 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 ...
user avatar
  • 554
1 vote
1 answer
177 views

Why inode numbers of /dev and /run are same as that of /? [duplicate]

Please see below output: In below output, the inode numbers of /dev and /run are same and equal to 2. The inode numbers of ./ and ../(could be a special case as ../ should point to ./) are also 2 and ...
user avatar
  • 554

1
2 3 4 5 6