Root filesystem readonly — EROFS errors
Read-only file system errors when writing
Focused incident mode — strips away everything but this runbook.
Symptoms
- Read-only file system errors when writing
- mount -o remount,rw fails with errors
- dmesg shows EXT4-fs error or I/O errors
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
Mount options
mount | grep ' / 'Kernel I/O errors
dmesg | grep -i 'error\|readonly\|remount\|ext4\|I/O'
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- dmesg shows I/O errors or blk_update_request errors
- Disk SMART data shows reallocated sectors
Confirm before fixing
smartctl -a /dev/sda | grep -i 'reallocated\|pending\|uncorrectable'Check SMART health data on the disk
Fix
mount -o remount,rw /Try remounting as a temporary fix; plan disk replacement
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
mount | grep ' / 'Confirm the root filesystem is readonly
dmesg | grep -i 'error\|readonly\|remount' | tail -30Find the reason the kernel remounted readonly
mount -o remount,rw /Attempt to restore read-write access
shutdown -r nowReboot into single-user mode and run fsck if remount fails
Prevention
- Use UPS with automatic shutdown to prevent unclean power loss.
- Monitor SMART health and alert on reallocated/pending sectors.
- Run periodic filesystem checks (e2fsck) during maintenance windows.
- Use a separate /var partition so a rootfs readonly does not lose all logging.
Related runbooks
Same stack, same failure family — worth a skim.
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.