Linux Diagnostics and Troubleshooting Series. Linux Storage Stack Orientation.
The Linux storage stack-
Troubleshooting storage issues in Linux systems for example RHEL should start with an understanding of how I/O is passed from applications through the Linux storage stack to storage devices.
Applications read & write from storage by sending standardized system calls to the kernel. The kernel processes these system calls through d storage stack, various layers of SW, and HW to ensure that application data may be successfully stored & accessed on the HW storage device. The storage stack allows application programmers to access data in a standardized way while offloading the work of writing code to interact with specific filesystem implementations and storage devices to kernel programmers.
The storage stack also provides a number of features to improve the performance and reliability of I/O operations. The entire Linux storage stack can be represented by the following diagram:
The Virtual Filesystem (VFS) -
The Virtual Filesystem (VFS) provides support for the standard POSIX system calls that applications use to read and write files.
It implements a common file model so that applications can use the same system calls such as create(), open(), read(), write(), and map() to access files without needing to deal with details of the underlying filesystem implementation. This means that a user can work with files stored on different filesystems without needing to rewrite their applications or tools like cp or mv to support the new filesystem, as long as those programs use the common file model when working with files. In turn, specific filesystem implementations such as XFS, ext4, FAT32, and so on can be plugged into VFS as code modules so that the common file model can be used to access data located on storage using those filesystems.
For eg, Linux apps assume dat directories can be handled like files. Diff filesystems actually store directory data in diff ways. VFS ensures dat apps can treat directories like files while working with d FS code to correctly handle d true implementation of directories in dat FS. VFS also maintains several caches to improve storage I/O performance, the inode, dentry, buffer & page cache. Of these, d most important is d page cache. It's dynamically allocated from free memory on the d system, & is used to cache pages of data from files being read or written.