Skip to main content
RunBook Academy

LinuxXVIII · Enterprise StorageFailure paths

Shared storage failure paths - reading a host whose storage has gone away

Advanced⏱ ~18 minbashmultipathfindmntpsdmesg

What you'll learn

  • Distinguish path loss, total path loss, filesystem shutdown and NFS server loss from the host side
  • Choose diagnostics that do not hang on the filesystem you are investigating
  • Read D-state processes back to the device that is blocking them
  • Apply the recovery order: restore the path first, then the filesystem
  • Explain why umount -l on a hung mount hides the problem rather than solving it

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-11

Not yet marked complete on this device.

Shared storage has a property no local disk has: it can vanish while the host is otherwise perfectly healthy. The CPU is idle, memory is fine, the network is up, and every process that touched the array is in D state where no signal reaches it.

It also has a property that makes the incident harder than it needs to be. The obvious diagnostics hang. df hangs. ls on the mount point hangs. Tab-completing a path in your own shell hangs, and now you have lost the session you were investigating from. Knowing which commands are safe is not a detail here; it is the first skill.

Four shapes, and they need different responses

ShapeHost symptomStorage still there?Fix
Path loss, paths remainingNothing visibleYesRestore the path; no filesystem work
All paths lostD-state processes, or sudden I/O errorsNoRestore paths, then check the filesystem
Filesystem shut downEIO on everything, mount still listedYesUnmount and remount; paths are not the problem
NFS server goneD state, df hangs, no EIO everNoRestore the server; do not force-unmount

The middle two are the ones people confuse, and confusing them wastes the outage: hunting for a fabric problem when the fabric is fine and the filesystem shut itself down, or remounting a filesystem while the paths are still flapping.

Diagnostics that do not hang

The rule is simple. Anything that calls statfs() or stat() on the affected mount will block. Anything that reads /proc/self/mountinfo, /sys or /proc/<pid> will not.

Read-only / Safemount table without touching the filesystems
$ findmnt -o TARGET,SOURCE,FSTYPE,OPTIONS -t nfs4,xfs,ext4
TARGET     SOURCE                        FSTYPE OPTIONS
/          /dev/mapper/vg0-root          ext4   rw,relatime
/srv/data  /dev/mapper/mpatha            xfs    rw,noatime
/srv/share nfs01.example.com:/export/dat nfs4   rw,_netdev,hard

Illustrative output

If you must use df, scope it to one filesystem you know is healthy (df -h /) or exclude the suspect types (df -h -x nfs -x nfs4 -x cifs). Running bare df during a filer outage is how the second engineer loses their session too.

Read-only / Safewho is blocked, and in what
$ ps -eo state,pid,ppid,wchan:28,comm | awk 'NR==1 || $1=="D"'
S   PID  PPID WCHAN                        COMMAND
D  2841  2837 io_schedule                  postgres
D  2903  2837 io_schedule                  postgres
D  4117     1 rpc_wait_bit_killable        rsync

Illustrative output

For the block-device case, walk from the process to the device:

# what the process was doing, from the kernel side (needs root)
sudo cat /proc/2841/stack

# what files it has open, without touching them
sudo ls -l /proc/2841/fd

# the SCSI device state for every path: running, offline or blocked
grep . /sys/block/sd*/device/state

# iSCSI session state, if this is iSCSI
grep . /sys/class/iscsi_session/session*/state

/sys/block/sdb/device/state is the fastest single answer for a SAN incident. running is healthy; offline means the SCSI layer gave up on the device; blocked means the transport layer has it quarantined while it waits for the fabric.

Shape 1 and 2: paths

Read-only / Safedegraded, not down
$ multipath -ll mpatha
mpatha (3600508b400105e210000900000490000) dm-3 NETAPP,LUN C-Mode
size=10T features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=0 status=enabled
| |- 6:0:0:1 sdb 8:16 failed faulty running
| `- 6:0:1:1 sdd 8:48 failed faulty running
`-+- policy='service-time 0' prio=10 status=active
|- 7:0:0:1 sdf 8:80 active ready running
`- 7:0:1:1 sdh 8:112 active ready running

Illustrative output

When the last path goes, the behaviour is whatever no_path_retry was set to - queue forever and hang, or fail and return EIO. That choice, and why a finite retry count is usually right, is covered in the multipath lesson; what matters here is recognising which one you are looking at.

Read-only / Safethe kernel timeline
$ sudo dmesg -T | grep -E 'blocked for more than|rejecting I/O|Device offlined|failing path|I/O error, dev'
[Tue Aug 11 03:14:22 2026] device-mapper: multipath: 253:3: Failing path 8:16.
[Tue Aug 11 03:14:22 2026] device-mapper: multipath: 253:3: Failing path 8:48.
[Tue Aug 11 03:16:29 2026] INFO: task postgres:2841 blocked for more than 120 seconds.
[Tue Aug 11 03:16:29 2026] blk_update_request: I/O error, dev dm-3, sector 4194304 op 0x1:(WRITE)

Illustrative output

Shape 3: the filesystem shut itself down

This one is different in kind. The LUN is present, every path is active ready running, and the filesystem still returns errors for everything. XFS detected a metadata inconsistency or an unrecoverable write error and shut itself down deliberately.

XFS (dm-3): metadata I/O error in "xfs_buf_iodone_callback_error" at daddr 0x400 len 8 error 5
XFS (dm-3): Log I/O Error Detected. Shutting down filesystem
XFS (dm-3): Please unmount the filesystem and rectify the problem(s)

ext4’s equivalent is quieter and is the reason errors=remount-ro exists:

EXT4-fs error (device dm-3): ext4_journal_check_start:83: Detected aborted journal
EXT4-fs (dm-3): Remounting filesystem read-only

Shape 4: the NFS server is gone

A hard NFS mount never returns an error. That is the contract: retry until the server comes back, so that an application which does not check its write return codes cannot silently lose data. The cost is that every process touching the mount goes into D state and stays there.

Read-only / Safeconfirm hard versus soft
$ grep -c . /proc/self/mountstats; findmnt -t nfs4 -o TARGET,SOURCE,OPTIONS
412
TARGET     SOURCE                            OPTIONS
/srv/share nfs01.example.com:/export/data    rw,relatime,vers=4.1,hard,proto=tcp,timeo=600,retrans=2

Illustrative output

Recovery order

  1. Identify the shape before touching anything. findmnt for the mounts, ps for D-state processes and their WCHAN, dmesg -T for the timeline, multipath -ll for the paths. All read-only, none of them hang.
  2. Restore the transport. Fabric, switch, NIC, iSCSI session, filer. Nothing above this layer can be fixed while it is broken.
  3. Wait for the paths to be stable, not merely present. Several minutes of every path active ready running, confirmed twice.
  4. Only then address the filesystem. A shut-down XFS or a read-only ext4 needs an unmount and remount; a healthy filesystem that was merely queueing needs nothing at all.
  5. Verify the data, not the mount. Application-level checks - row counts, checksums, a read of the most recently written file - because an I/O error that reached the application may have left a partial write behind.
  6. Write down the path-count alert you did not have. Every one of these incidents was visible as a degraded path days earlier.

Knowledge check

Knowledge check · 4 questions

  1. Q1. A host has processes in D state. multipath -ll shows all four paths active ready running, and dmesg contains "XFS (dm-3): Log I/O Error Detected. Shutting down filesystem". What is the correct next step?

  2. Q2. Which commands are safe to run on a host whose NFS server has disappeared, without blocking your own shell? Select all that apply.

  3. Q3. A lazy unmount (umount -l) removes a hung mount from df and findmnt while the processes blocked in it stay in D state.

  4. Q4. A monitoring check confirms /srv/data is mounted and writable. It has passed continuously for three weeks. What class of failure is it structurally unable to see?

Passing score: 75%. Answers are checked in this browser.