Storage Fundamentals Series

📂 Understanding How NFS Works From a Top 1% Perspective — iSCSI Hands Over 'the Disk Itself,' While NFS Hands Over 'an Already-Organized Shelf'

Introduction

This article is part of the Top 1% Series Complete Article Guide, and article 7.2 in the Storage Fundamentals Series.

Prerequisite Knowledge

Getting the Big Picture

iSCSI hands “the disk itself” (a block device) over to the client. The client side bears the responsibility of creating and managing its own filesystem on that block device it received. NFS (Network File System) operates at an entirely different layer. The NFS server itself already manages the filesystem, and the client just receives an already-organized directory tree (files and folders) as-is — nothing more needed.

graph TB
    subgraph ISCSI["iSCSI (Block-Level)"]
        Server1["iSCSI Target"] -->|"Hands over a raw block device"| Client1["Client<br/>(creates and manages its own filesystem)"]
    end
    subgraph NFS["NFS (File-Level)"]
        Server2["NFS Server<br/>(manages the filesystem)"] -->|"Hands over an already-organized directory tree"| Client2["Client<br/>(just reads/writes files directly)"]
    end

Deep Dive Into the Fundamentals

How Safe Concurrent Access Is, for Multiple Clients, Differs Fundamentally

NFS naturally supports multiple clients mounting and reading/writing the same directory at the same time, through a protocol-level locking mechanism. With iSCSI, if multiple clients access the same LUN (block device) concurrently without coordination, data corruption becomes a real risk, unless you’re using a cluster-aware filesystem. This difference directly decides which mechanism you should choose, whenever you have a requirement for “multiple servers accessing the same data at the same time.”

The Evolution From NFSv3 to NFSv4: Stateless to Stateful

NFSv3’s protocol itself was stateless, and file locking was handled by a separate ancillary protocol called NLM. This setup required multiple ancillary services — mountd, NLM, NSM — each using its own port, making operation across a firewall difficult, and carrying a stale-lock problem during failover, where old lock information lingered. NFSv4 integrated the locking mechanism into the protocol itself, becoming a stateful design. This means communication consolidates onto just one single TCP port, 2049, making operation across a firewall dramatically easier.

NFSv4 Also Supports Kerberos Encryption Natively

NFSv4 natively supports Kerberos authentication and encryption (using it is optional). Since all communication is consolidated onto that one port, 2049, enabling Kerberos encrypts NFS’s entire traffic, including mount operations and lock information. This was a design that was difficult to achieve under NFSv3’s older setup, with its ancillary protocols scattered across multiple ports.

What a Pro Sees Here (Top 1% Understanding)

“Block or File” Is a Question of Fit for the Requirement, Not Technical Superiority

iSCSI and NFS aren’t in a simple relationship of one being superior to the other. Whether you want “to decide for yourself which filesystem to use on the client side,” or “to safely access the same data concurrently from multiple clients” — this difference in the requirement itself decides which one you should pick. Understanding that behind the single word “storage,” entirely different abstraction layers — block-level and file-level — exist, lets you make storage technology choices based on requirements, not mere preference.

Common Misconceptions and Pitfalls

Troubleshooting Perspective

  1. Data got corrupted after multiple clients accessed the same iSCSI LUN: Check whether you were using a cluster-aware filesystem, or whether a file-level mechanism like NFS should have been used instead.
  2. NFSv3 isn’t working well across a firewall: Check the port-opening configuration for ancillary services like mountd, NLM, and NSM, or consider migrating to NFSv4.
  3. After a failover, an old lock lingers and a file won’t open: Check for NFSv3’s stale-lock problem, and consider migrating to NFSv4.

Summary

Takeaways to Apply Today

  1. When you have a requirement for multiple clients to safely access the same data concurrently, consider a file-level mechanism like NFS.
  2. When newly deploying NFS, choose NFSv4 over NFSv3.

References

Comments

Feel free to leave thoughts, questions, or corrections below (sign in with a GitHub account to comment or react).