Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [inode]

The tag has no usage guidance, but it has a tag wiki.

178
votes
7answers
333k views

Find where inodes are being used

So I received a warning from our monitoring system on one of our boxes that the number of free inodes on a filesystem was getting low. df -i output shows this: Filesystem Inodes IUsed ...
116
votes
5answers
115k views

What is a Superblock, Inode, Dentry and a File?

From the article Anatomy of the Linux file system by M. Tim Jones, I read that Linux views all the file systems from the perspective of a common set of objects and these objects are superblock, inode, ...
56
votes
6answers
133k views

How can I increase the number of inodes in an ext4 filesystem?

I had a problem (new to me) last week. I have a ext4 (Fedora 15) filesystem. The application that runs on the server suddenly stopped. I couldn't find the problem at first look. df showed 50% ...
50
votes
2answers
29k views

List all files with the same inode number?

Lets say, when I do ls -li inside a directory, I get this: 12353538 -rw-r--r-- 6 me me 1650 2013-01-10 16:33 fun.txt As the output shows, the file fun.txt has 6 hard links; and the inode number is ...
45
votes
9answers
102k views

How do I count all the files recursively through directories

I want to see how many files are in subdirectories to find out where all the inode usage is on the system. Kind of like I would do this for space usage du -sh /* which will give me the space used in ...
43
votes
4answers
49k views

Quickly find which file(s) belongs to a specific inode number

I know of this command: find /path/to/mountpoint -inum <inode number> but it is a very slow search, I feel like there has to be a faster way to do this. Does anybody know a faster method?
35
votes
5answers
8k views

Can I run out of disk space by creating a very large number of empty files?

It is well-known that empty text files have zero bytes: However, each of them contains metadata, which according to my research, is stored in inodes, and do use space. Given this, it seems logical ...
30
votes
2answers
3k views

Why do the directories /home, /usr, /var, etc. all have the same inode number (2)?

I find that under my root directory, there are some directories that have the same inode number: $ ls -aid */ .*/ 2 home/ 2 tmp/ 2 usr/ 2 var/ 2 ./ 2 ../ 1 sys/ 1 proc/ I only know that the ...
28
votes
2answers
2k views

Why does a software package run just fine even when it is being upgraded?

Say I am running a software, and then I run package manager to upgrade the software, I notice that Linux does not bring down the running process for package upgrade - it is still running fine. How ...
26
votes
4answers
13k views

Can a file be retrieved by its inode?

I ran following commands in the order specified: $ln a b $ls -i a b 523669 a 523669 b $rm -f a $ls -i b 523669 b I concluded from this test that the command rm actually removes only the filename (a ...
25
votes
2answers
26k views

How can I find the number of files on a filesystem?

I want to know how many files I have on my filesystem. I know I can do something like this: find / -type f | wc -l This seems highly inefficient. What I'd really like is to do is find the total ...
20
votes
2answers
6k views

why inode value changes when we edit in “vi” editor?

When I edit a file in "vi" editor the inode value of the file is changing. But when edited with cat command the inode value is not changing.
19
votes
3answers
2k views

Why is the inode table usually not resizable?

Unix file systems usually have an inode table, and the number of entries in this table is usually fixed at the time the file system is created. This sometimes leads to people with plenty of disk ...
17
votes
2answers
2k views

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

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 ...
16
votes
2answers
670 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 ...
16
votes
3answers
24k views

What is an orphaned inode? [closed]

I understand what an inode is but what is the exact definition of an orphaned inode? I don't really get what that means. UPDATE There was a time that a server I was managing ran out of inodes but ...
12
votes
3answers
65k views

How do I find the inode of any directory?

There is literally nothing on google that I can find that will help me answer this question. I presume it is passing some other parameter to ls -i?
12
votes
2answers
12k views

Is it possible to change Inode count on an ext4 filesystem? [duplicate]

Possible Duplicate: How can I increase the number of inodes in an ext4 filesystem? I have a homemade NAS with Debian Wheezy 64bit. It has three disks - 2x2TB and 1.5TB, pooled together using ...
11
votes
4answers
2k views

Why do special device files have inodes?

Device files are not files per se. They're an I/O interface to use the devices in Unix-like operating systems. They use no space on disk, however, they still use an inode as reported by the stat ...
11
votes
1answer
355 views

Does inode number determine what files were created earlier than others?

In an ext4 filesystem, suppose that file1 has inode number 1, and that file2 has inode number 2. Now, regardless of any crtime timestamp that might be available, is it wrong to assume that file1 was ...
10
votes
2answers
1k views

Why does the Linux kernel report “out of disk space” when in reality it is out of i-nodes

A friend of mine who likes programming in the Linux environment, but doesn't know much about the administration of Linux recently ran into a problem where his OS (Ubuntu) was reporting "out of disk ...
10
votes
6answers
6k views

Portable way to find inode number

At first I used stat -c %i file (to help detect the presence of a jail), which seemed to work on any Linux distribution under the sun. On OS X' I had to use ls -i file | cut -d ' ' -f 1. Is there ...
10
votes
2answers
3k views

Is it possible to rename a file or directory using the inode?

I changed the /home directory to a different partition and couldn't access the files from it, something I have been able to solve from this question - How do you access the contents of a previous ...
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 ...
9
votes
3answers
1k views

Memory size for kernel mmap operation

I'm interested in the way Linux mmaps files into the main memory (in my context its for executing, but I guess the mmap process is the same for writing and reading as well) and which size it uses. So ...
8
votes
2answers
4k views

Difference between xattr and chattr

What is the relation and the difference between xattr and chattr? I want to know when I set a chattr attribute in Linux what is happening inside the Linux kernel and inode metadata.
7
votes
2answers
3k views

Why does '/' have the inode 2?

On many *nix systems like OS X and Ubuntu, We can see the inode of root directory is 2. Then what is the inode 1 used for?
7
votes
1answer
108 views

Why directory with large amounts of entries does not shrink in size after entries are removed?

Close vote notice: While the linked duplicate asks same question, the comments and the only answer do not provide an answer which draws from authoritative source. The answer on my question by Thomas ...
7
votes
2answers
2k views

what does a “deleted file” entry look like in the journal

I hope I've got this right: A file's inode contains data such as inode number, time of last modification, ownership etc. – and also the entry: »deletion time«. Which made me curious: ...
6
votes
3answers
8k views

“mv” file with garbled name by inode number?

I have several files with encoding issues in their file names (German umlauts, burned on CD with Windows, read by Windows and synced to Linux with Seafile. Something, somewhere went wrong...). Bash ...
6
votes
4answers
11k views

Work out the link count of inode number?

How can I work out the link count of an inode number? If I know the inode number is, say, 592255 - what workings out can I do to find out the link count? I know directories have a link count of at ...
6
votes
2answers
4k views

Why restrict the number of inodes a user can access?

It appears that it is possible on a network mount to set a quota on how much space a user can consume. # edquota ramesh Disk quotas for user ramesh (uid 500): Filesystem blocks ...
6
votes
4answers
4k views

What are inodes good for?

I wonder if storing the information about files in inodes instead of directly in the directory is worth the additional overhead. It may be well that I'm overestimating the overhead or overlooking some ...
6
votes
2answers
2k views

Understanding sparse files, dd, seek, inode block structure

At work we use sparse files as part of out Oracle VM environment for the guest disk images. After some questions from a colleague (which have since been answered) I am left with more questions about ...
6
votes
2answers
10k views

Drawbacks of increasing number of inodes in EXT4

I am currently using backintime to take "snapshots" of my file system. It is similar to rsnapshot in that it, makes hard links to unchanged files. I have recently run out of inodes on my EXT4 ...
6
votes
3answers
179 views

What characterizes a file in Linux/Unix?

What characterizes a file in Linux/Unix? A file can have many types: regular file, directory, symlink, device file, socket, pipe, fifo, and more that I miss. For example, a symlink: $ sudo file /...
6
votes
1answer
1k views

Limit the inode cache used by a command

I want to run a task with limits on the kernel objects that they will indirectly trigger. Note that this is not about the memory, threads, etc. used by the application, but about memory used by the ...
5
votes
3answers
2k views

How to use all the inodes

Without creating a file can I use any inode which is free? I want to write a script that will use all free inodes in the system. is it possible?
5
votes
4answers
10k views

Does the inode change when renaming or moving a file?

in PHP the fileinode() functions returns the inode of a file. I was wondering if I can use it to determine if a file was renamed, moved or modified. I did some tests and it seems the inode stays the ...
5
votes
2answers
3k views

Why does renaming a file with mv command alter an inode's “change” date & time?

A file hello.c is renamed to hi.c. As the output of stat command shows, [change] time stamp has been changed. usually it is changed when inode of file got modified. Why renaming with mv command ...
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-...
5
votes
1answer
4k views

On what occasion will inode change?

I checked manual of find , and there's an option -ctime which specify the last modification time of inode. But on what occasion would inode change ? When is that option useful ?
5
votes
1answer
495 views

why do Linux bind mounts disappear if the mount point's inode changes?

In summary: if you bind mount a file /tmp/a on top of /tmp/b in a new mount namespace, but then the inode of /tmp/b changes in the parent namespace, the bind mount disappears in the child namespace. I'...
5
votes
1answer
213 views

Is there a tool to create a hard link to an unlinked inode?

Assume you have a filename/directory name, whatever, which is hard linked to inode 6400. Alas, the file/directory actually exists (completely intact, and maybe it only lives in a single data block, ...
5
votes
1answer
1k views

Where is information about hard/soft links stored?

Where does the *nix system store information about number of hard links to a specific inode? I can't find any information about that. Everywhere what a hard link is but rarely a bit more advanced ...
5
votes
3answers
4k views

Is there a way to identify the PID (or cgroup) of a socket without iterating through all the processes in /proc/

I need to identify the cgroup of a process given the socket. Specifically, I have a process on the same machine that is calling my process using tcp, and I need to identify the process or its cgroup. ...
5
votes
0answers
4k views

Exundelete can't restore the file

I'm trying to restore 2 important tar.gz files I know their directory but extundelete not restoring them although it's giving me the inode number. Loading filesystem metadata ... 2127 groups loaded. ...
5
votes
1answer
885 views

What are the implications of using an inode_ratio of 16384 in terms of storage use on ext4?

I'm assuming that this means that if the average file stored (including directories etc) is less than 16384 bytes, it may be possible to run out of inodes before using the full storage capacity of the ...
4
votes
4answers
3k views

How come that inodes of directories store filenames in ext4 filesystem?

A directory inode isn't substantially different from that of a regular file's inode, what I comprehend from Ext4 Disk Layout is that: Directory Entries: Therefore, it is more accurate to say ...
4
votes
2answers
719 views

Is there an inode for a directory?

Each file has an inode. Is there an inode for every directory ? If not, how does Linux manage directories.