File Systems in Linux

June 2, 2021 0 Comments

File Systems in Linux

File systems in Linux, File systems are services in an operating system that will manage files over the disk.

File system organized disk into four.

  1. Boot Block
  2. Super Block
  3. Inode Block
  4. Data Block

File system Block (Superblock and Inode Block)

Boot BlockSuper Block
file 0+1+1+1
Dentry 0+1
Inode Block
xyz.txt p flags block 3
abc.txt p flags block 5
text.txt p flags block 9
dr p flags
Data Block 1Data Block 2Data Block 3
xyz.txt
Data Block 4Data Block 5
abc.txt
Data Block 6
Data Block 7Data Block 8Data Block 9
text.txt

From Boot block, a set of blocks (superblock & inode block) are reserved for use of file system called FS block.

The inode is a data structure that contains the specific partition file system (files information).

The superblock contains macro-level information of the inode block.

Every file system part of an operating system will maintain a private memory called a file system inode cache where are the inodes of those files created under this filesystem or copied.

For a mount operation to succeed a compatible file system service that can understand the format of the superblock and inode table is required.

Mounting command in Linux syntax : mount -t <fs type> <device> <dir>

Example: mount -t ext4 /tmp/disk.img /mnt

Virtual File System(VFS):

VFS will also maintain its own cache where will it maintain a copy of filesystem-specific inodes which are generic to all filesystems.

The VFS abstraction provides the following benefits for the application developers and users.
1) A limited common API interface to initiate operations on any type of file.
2) All mounted files can be unified into a single file tree.
3) Changes to the file system layer will not affect existing applications.
4) Support for new file systems will not require changes to the application layer.

For more detail on Linux Filesystem types, superblock, Inode block structures click here

Share This: