The-Linux-File-System
The-Linux-File-System
1. Fundamental Concepts
- The Linux file system is used to organize and store files and data on a computer.
It is based on the Unix file system, which was designed to be scalable, flexible,
and easy to use.
- The Linux Operating System is designed to support multiple file systems, each
with its own characteristics and features.
Directory structure in Unix/Linux:
- Unix uses a hierarchical file system structure, which resembles a top-to-bottom
tree structure, with the root (/) at the base of the file system and all other directories
spreading out from there.
- Each file and directory is uniquely identified by its name, the directory in which
it resides, and a unique identifier, typically called the i-node.
The most heavily used calls are undoubtedly read and write.
3. NFS: The Network File System
- NFS (Network File System) is a file sharing protocol system developed by Sun
Microsystems since 1984, allowing a user on a client computer to access a shared
file system through a computer network such as Direct access on hard drive.
- Three aspects of NFS are of interest: the architecture. the protocol, and the
implementation.
NFS Architecture:
NFS is implemented using a client-server architecture, where one computer acts as
a server and the other computers act as clients. The server stores and manages the
files, while the clients access and manipulate them through network requests. The
clients and the server communicate using the Remote Procedure Call (RPC)
protocol, which allows them to invoke procedures on each other. The clients can
mount the server’s file system as part of their own file system and access the files
as if they were local. This provides transparency and convenience for the users.
NFS Protocols:
NFS uses a stateless protocol, which means that the server does not keep any
information about the state of the clients or the files. Each request from the client
contains all the information that the server needs to fulfill it, such as the file
handle, the offset, the length, etc. The server responds with the data or the status of
the operation, and then forgets about the request. This makes the server simpler
and more robust, as it does not have to deal with complex issues such as
concurrency control, caching, locking, recovery, etc. The clients are responsible for
handling these issues locally.
NFS Implementation:
NFS is designed to be portable across different machines, operating systems,
network architectures, and transport protocols. This portability is achieved through
the use of External Data Representation (XDR), which is a standard way of
encoding data for transmission over the network. XDR ensures that the data can be
interpreted correctly by different platforms, regardless of their byte order, word
size, alignment, etc. NFS also supports different versions of the protocol, such as
NFSv2, NFSv3, and NFSv4, which have different features and capabilities. The
clients and the server negotiate the version that they will use during the mount
process.