An index node is the basic data structure used to manage file systems running Unix-like operating systems. Each inode is uniquely identified within a file system by its inode number. Each name entry in a directory refers to exactly one inode. This contains the metadata of the file and refers to the data of the file or the file list of the directory.
The application software no longer distinguishes between device drivers and regular files when reading or writing data. Due to the inode concept, everything is considered a file in the Unix variants. As a result, such operating systems differ in the management of their data storage from other systems such as Windows with NTFS, but also from VMS or MVS.
If you save a file on a computer, not only the file content (payload) must be stored, but also metadata such as the time the file was created or the owner of the file. At the same time, the computer must be able to efficiently assign the corresponding payload and metadata to a file name – including the file path. The specification of how this data is organized and stored on disk is called the file system. Depending on the area of application and operating system, there are different file systems. The file system specification is implemented by a driver, which can be implemented either as a kernel module of the operating system kernel or, more rarely, as an ordinary program in userspace.
---

Rough Structure of the Unix File System
File systems of Unixoid operating systems – such as Linux and macOS – use so-called inodes. These contain the metadata as well as references to where payloads are stored. In turn, a special location of the file system, the superblock, stores the size, number and location of the inodes. The inodes are numbered consecutively and stored in one piece on the data carrier. The root directory of a file system has a fixed inode number. Subfolders are “ordinary” files that contain a list of the files contained in them with the assignment of the corresponding inode numbers as payloads.
So, for example, if you want to open the file /bin/ls, this is how it works, simplified, as follows:
- The file system driver reads the superblock. This tells him the starting position of the inodes and their length.
- This means that any inode can now be found and read.
- Now the inode of the root directory is opened. Since this is a folder, it contains a reference to the location of the list of all the files it contains, along with their inode numbers. In it, the directory bin is searched.
- Now the inode of the bin directory can be read and found analogous to the last step of the inode of the file
ls.
Since thelsfile is not a directory but a regular file, its inode now contains a reference to the location of the desired data.
Construction
Each individual name bounded by a slash has exactly one inode associated with it. This stores the following meta information about the file, but not the actual name:
- The type of file (regular file, directory, symbolic link, …);
the numerical identifier of the owner (UID, user id) and the group id (GID, group id); the access rights for the user, the group and all others; - The classic user and rights management is done with the programs (change owner), (change group) and (change mode). Access Control Lists (ACL) allow for a finer assignment of rights. See chown chgrp chmod
different points in time of the file: creation, access time and modification time); - the time of the last status change of the inode (status, ctime);
- the size of the file;
- the link counter (see below);
- one or more references to the blocks where the actual data is stored.