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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [inode]

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

0
votes
0answers
29 views

Why do ext2 inodes only have 12 direct blocks?

I'm currently writing a hobby file-system for fun. I was wondering if anyone knows why or where I could get information on the design philosophy of ext2. Specifically, I was wondering why each inode ...
1
vote
3answers
931 views

Why does find -inum iterate through the whole filesystem tree?

It surprises me to see find iterate/walk through the complete filesystem when I do a simple find -inum 12345 Without background info it seems to me that there should be much easier ways for to tell ...
2
votes
1answer
32 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 ...
3
votes
1answer
213 views

How exactly are files located under the hood? [closed]

As far as I know, once an inode of a file is found, finding the data is trivial - done by accessing a specific location on the disk, which is stored in the inode. The question however is how exactly ...
-1
votes
1answer
18 views

Too many inode?

I am using a MacBook Pro, and I found something weird recently, which is the number of ifree is ridiculously large. The following is the output of the df command: $ df -i -h Filesystem Size ...
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 ...
2
votes
1answer
915 views

How to speed up directory listing on high-inode partitions?

I have almost 7,000 files in a single directory which makes loading that particular directory a tedious and time-consuming one. Is there any way to list and perform operations on files in that ...
16
votes
2answers
669 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 ...
2
votes
1answer
93 views

Is pCloudDrive really inaccessible to root?

pCloud is a cloud storage service that allows Linux users to mount their cloud storage inside of their home directory, appearing as: /home/username/pCloudDrive/ As far as I can tell, the pCloudDrive ...
0
votes
1answer
62 views

How should we understand symlinks under `/proc/pid/fd`?

They seems more like a link to inode instead a link to path. What does the readlink() mean to them, the canonical path of the inode from the calling process's root directory? What happened when a ...
116
votes
5answers
114k 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, ...
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 /...
0
votes
2answers
164 views

How do inode numbers from ls -i relate to inodes on disk

I'm trying to understand how inode numbers (as displayed by ls -i) work with ext4 partitions. I'm trying to understand whether they are a construct of the linux kernel and mapped to inodes on disk, ...
44
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 ...
4
votes
1answer
750 views

size of directory reported by ls [duplicate]

I understand the size reported by ls corresponds with number of inodes inside the directory, not their actual size. I have noticed peculiar behavior, when displaying directory size with ls. Here is ...
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 ...
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 ...
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 ...
1
vote
1answer
2k views

debugfs and “Bad magic number”

I'm trying to get file creation time using whatever I could find on the Internet and there's generally one solution that works for everybody, and this is the tutorial: https://tecadmin.net/file-...
0
votes
2answers
37 views

Find out which process has data open on the hard drive that is no longer visible in the directory tree [duplicate]

On my server, the root partition is 73GB, but the disk says, it is full, although there are only about 6GB used on that device: # df -h Filesystem Size Used Avail Use% Mounted on ...
3
votes
0answers
1k views

Foremost file naming - Recovery of file names from inodes

I have been asked to recover some files from a corrupt Linux partition. The partition data is shot to pieces but i have been able to locate the file names and the associated Inode number. Using ...
1
vote
0answers
12 views

I Node and Data Retrieval

Is there a way possible to open a data block without the file if we know the i node number that it's linked to ? Is it possible to open the content in data block without the file ?
0
votes
0answers
113 views

Whose `I-Node` does `netstat -ap` for unix domain sockets refer to?

What does I-Node mean in the output of netstat -ap for unix domain sockets? It seems not the same as the inode of the socket file: $ netstat -ap ... Active UNIX domain sockets (servers and ...
1
vote
0answers
54 views

'No space left on device' error thrown when generating large amount of files, but there is no clear limit being reached

Running a python script to generate millions of empty text files just for fun on my Mint machine (18.1 Serena) before I wipe it. Recently the script failed with this error: OSError: [Errno 28] No ...
-1
votes
1answer
155 views

Number of occupied inodes via Quota?

Using the quota command, what is the number of occupied inodes by you in your pool account home directory? Find them out, with what type of file how many inodes you occupy?
0
votes
3answers
183 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 ...
3
votes
3answers
1k views

List only regular files [duplicate]

I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la (ll). I went to the man ls searching for type and found only this ...
0
votes
1answer
157 views

Is it possible to read a file you only have executable permissions to on Linux through Bash?

I was wondering if it was possible to somehow get the contents of a file which you do not have read access to. I first attempted trying to get around the permissions using the inode number of the file,...
3
votes
1answer
115 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
50 views

How do I format a hard drive EXT4 with lowest possible inode disk usage (for 1 Dir and 1 Massive File)?

I am trying to prepare a hard drive for burst mining on linux and want to maximize the hard drive space available for the plot file. So for this I need to set the inodes to the minimum possible that ...
1
vote
1answer
161 views

Filesystem design: necessity of inode number and table [closed]

The *nix filesystems maintain an inode table at the beginning of the disk (or at some fixed location). It is indexed by the inode number, which is an integer that uniquely identifies an inode. Knowing ...
0
votes
0answers
46 views

Why does the /run directory have inode 2? [duplicate]

It's well known that the / directory has inode number 2 (see also Why does '/' have the inode 2). And we also know that hard links share the same inode number. So far so good. Here's the confusing ...
0
votes
1answer
273 views

Understanding direct and indirect blocks?

Why can't we use use indirect blocks instead of direct blocks. Indirect blocks can store much more memory addresses which results in more data blocks. So why waste those 10 direct blocks in Inode ...
1
vote
1answer
53 views

Inode Timestamp Plus/Minus Interpretation

What does +0200 mean after the Access/Modify/Change timestamps? File: task-system.md Size: 197 Blocks: 24 IO Block: 4096 regular file Device: 33h/51d Inode: 14155787 Links: ...
2
votes
2answers
1k views

What is the association of an inode with a file?

I have learnt from some sources (such as: this), the following things: An inode is a data structure that stores relevant information about a file. An inode number points to an inode. There is a ...
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 ...
1
vote
1answer
1k views

increase the number of inodes online

Dears, I have a Redhat linux server Red Hat Enterprise Linux Server release 5.5 (Tikanga). It's a production sensitive server. now it ran out of inodes in /storage2 directory. It has many space but it ...
1
vote
1answer
201 views

How to change inode size on EXT2 file

I am running Ubuntu on my MacBook Pro as I need to reformat a hard drive to EXT2 with iNode size of 128 to use for DCP delivery.
2
votes
0answers
182 views

debugfs occasionally fails to read inode data

I need to get date and time when a file was created. The file is stored at ext4 filesystem so the information is available in the i-node and I use debugfs to read this information: # debugfs -R "stat ...
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% ...
1
vote
1answer
118 views

Why inode number is zero for writeback mechanism in linux kernel

I'm researching linux kernel. Right now only for v3.10.61, it's just proof of concept. I need to pass-through some hints to hardware about what kind of data in particular WRITE\READ operation. E.g. ...
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?
0
votes
1answer
122 views

Why is ls -i slower than ls?

I know that ls lists the names of the files in a given directory and ls -i shows the names and the inode numbers. But why is it slower? EDIT: This happens with big directories The names and the ...
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. ...
0
votes
4answers
509 views

How to find the parent of a file by inode

I want to use ntfsundelete to maintain the directory structure of the recovered files. The output of ntfsundelete is like this: Inode Flags %age Date Size Filename 191321 FN.. ...
1
vote
1answer
67 views

Cannot rm corrupt directory

CentOS6 I am logged in as root. It is a virtual machine running on a Windows 10 host in virtualbox as a vagrant machine. I tried chmod -R 777 /home/thomas/WWW chown -R root:root /home/thomas/WWW ...
-1
votes
2answers
228 views

File system Inode flags: difference between FS_IOC_GETFLAGS and FS_IOC_FSGETXATTR

What is the difference between FS_IOC_GETFLAGS and FS_IOC_FSGETXATTR ioctl commands? What flags do both return?
3
votes
2answers
633 views

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 ...
2
votes
0answers
57 views

From where ls gets inode info in a deleted directory [duplicate]

I am not able to understand ls and cd behaviour in following case : Create directory a/b/c $ mkdir a/b/c -p $ ls -lhRai .: total 324K 24512531 drwxrwxr-x 3 mayank mayank 312K May 22 16:23 . 24380771 ...
0
votes
0answers
434 views

High inode usage of nfs mount

The data files of my application are stored in an NFS mount of a Linux system. The inode capacity of the NFS share is approx 300 MB. Now there are two directories where the data files are generating. ...