Skip to main content

Operations of a modern DFS

Short answer

A distributed file system stores files on servers and provides transparent access. Sun NFS uses RPC with operations like lookup, read, write, create, remove, mkdir, and readdir, identified by file handles. It is stateless, ensuring idempotent operations and easy crash recovery.

What is distributed file system? Explain the principle operations of any one modern distributed file system.

Distributed file system

A distributed file system (DFS) stores files on servers across a network and lets clients access and share them as if they were local, with transparency, consistency and security.

Principal operations of a modern DFS: Sun NFS

Sun NFS is the most widely used DFS. It follows a client-server model, with a virtual file system layer and RPC.

 Client                     Server
 App -> VFS -> NFS client ==RPC==> NFS server -> VFS -> local FS

Principal operations (NFS server interface, via RPC)

  • lookup(dirfh, name): returns the file handle and attributes.
  • read(fh, offset, count) and write(fh, offset, count, data).
  • create, remove, rename, link, symlink.
  • mkdir, rmdir, readdir.
  • getattr(fh), setattr(fh, attr); statfs.

How an operation works

  1. First, a remote directory is attached to the local file tree by the mount service.
  2. The application makes a file system call (open/read).
  3. The VFS decides whether the file is local or remote using the v-node; remote requests go to the NFS client.
  4. The client sends an RPC with the file handle (file system id, i-node number, generation number) to the NFS server.
  5. The server's VFS maps the handle to the local file and executes the operation, returning data and attributes.
  6. The client caches blocks and attributes and treats them as valid for a short interval, checking timestamps with the server.

Properties: stateless server (idempotent operations, easy crash recovery), access and location transparency, caching with approximate consistency, support for heterogeneous systems, and security by user id or Kerberos.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 2 questions →