ext4 Remounts Root Read-Only When It Cannot Trust the Disk, and the kubelet Falls with It
ext4 protects its structure with a journal, and when the kernel detects errors it can't safely repair while running, it stops writing altogether: the root filesystem is remounted read-only, or the boot drops into emergency mode. The data is preserved, but every process that needs to write fails at once. On a Kubernetes node that means containerd, then the kubelet, then the node itself, which the control plane reports as NodeStatusUnknown.
What the Journal Guarantees
Before changing filesystem structures, ext4 first writes its intent to the journal. After a crash, the kernel replays or discards the unfinished transactions, so the directory tree stays consistent. By default (data=ordered) the journal covers metadata; file contents written at the moment of the crash can still be lost or stale. Journaling prevents a corrupt filesystem, not lost writes.
How a Node Ends Up Locked
- The node loses power or is hard-reset during shutdown, for example while systemd waits on containerd tearing down pod networking.
- The filesystem was not unmounted cleanly; at boot the kernel finds errors to check, or hits I/O errors from a failing disk.
- With the default error behaviour (
errors=remount-roon Debian), the kernel remounts/read-only to prevent further damage, orfsckmust run from emergency mode. - containerd cannot write its state and crashes; the CRI socket disappears; the kubelet crash-loops, unable to write under
/var/lib/kubelet. - Automation fails too: Ansible reports
Failed to create temporary directoryand scripts hitRead-only file system.
Preventing It
- Stop the kubelet and containerd before halting a node, so shutdown doesn't hang on container networking.
- Never cut power to "speed up" a stuck shutdown; wait or use the console.
- Watch disk health (SMART wear indicators) on old SSDs used as node disks.
findmnt -no OPTIONS / # "ro" in the list means locked
dmesg | grep -i -E 'ext4|i/o error'
References
- Kubernetes MOC - hub for Kubernetes notes.
- Linux Administration MOC - hub for Linux notes.
- Recover a Read-Only Root Filesystem with fsck - the recovery procedure.
- kubelet Depends on containerd Through the CRI Socket - why containerd's crash takes the kubelet down.
- The Read-Only Lockdown: Recovering a Bare-Metal Node from a Kernel Panic - the incident behind this note.
- With No Active Root Entry in fstab, systemd Leaves the Root Filesystem Read-Only on Every Boot - the look-alike that isn't a disk problem.
- Linux kernel documentation: ext4 mount options -
errors=anddata=modes.
Review cards
Flashcard Why does ext4 remount the root filesystem read-only when it detects unrecoverable errors?
To prevent further damage to the filesystem and ensure data integrity.
Flashcard fsck reports the filesystem clean, yet remounting read-write keeps failing. What's the likely cause?
The drive itself refuses writes: a worn-out SSD can lock itself read-only in firmware. Check smartctl -a, copy the data off and replace the drive.
Quiz Which of the following is a consequence of a node being locked due to ext4's read-only remount?
- The kubelet can continue to function normally.
- The node reports
NodeStatusUnknownto the control plane. - The node automatically reboots to fix the issue.
The kubelet cannot function properly when the filesystem is read-only.
Flashcard What should be done to prevent a node from being locked due to ext4's read-only remount?
Stop the kubelet and containerd before halting a node to ensure a clean shutdown.