errors

Read-only file system — distinguish policy from damage

EROFS means a requested mutation is not permitted on a read-only filesystem or mount. A deliberately read-only image, container bind mount or recovery mount is different from a filesystem forced read-only after an I/O or metadata error. Inspect the actual path in its mount namespace, not just /etc/fstab; findmnt shows the effective mount. Correlate authorized kernel logs with storage health and recent changes. If read-only is intentional, write to the approved writable volume. If unexpected with storage errors, stop writes, preserve evidence and use an approved offline recovery procedure; do not force a remount read-write or run repair on a mounted filesystem. Verify the recovered mount, data integrity and a bounded authorized write only after recovery approval. Roll back to the known-good mount configuration or restore verified backup in a maintenance window. Prevent with storage monitoring and tested restore procedures. The fixture models mount flags and an I/O-error indicator; it neither mounts nor triggers EROFS. Example prerequisites: Linux, Bash, Python 3. Run as a non-root user in a private temporary working directory. Example scope: synthetic model. Expected output: modeled intentional and unexpected read-only states distinguished. No system configuration changes.

Formal Syntax & Structure

linux syntaxlinux
findmnt -T PATH -o TARGET,SOURCE,FSTYPE,OPTIONS; authorized kernel logs

Parameters & Attributes

NameTypeDescription
OPTIONSdiagnostic evidenceEffective mount options such as ro or rw.
kernel logsdiagnostic evidenceEvidence of filesystem and device errors.
intentdiagnostic evidenceExpected read-only policy versus unexpected failure.

Return Value

Diagnostic observation

Expected normalized laboratory result: modeled intentional and unexpected read-only states distinguished. A passing fixture does not prove that a live incident has the same cause.

Working Example

Example Snippetlinux
python3 - <<'PY'def decision(opts, io_error):    if 'ro' not in opts.split(','): return 'inspect other causes'    return 'stop writes; recovery review' if io_error else 'use approved writable volume'assert decision('ro,nosuid',True)=='stop writes; recovery review'assert decision('ro,nosuid',False)=='use approved writable volume'assert decision('rw,nosuid',False)=='inspect other causes'print('modeled intentional and unexpected read-only states distinguished')PY
Linux Reference