Error Codes Wiki

Linux errno 30 EROFS — Read-Only File System

Errorerrno

About Linux errno 30 EROFS

Linux errno 30 (EROFS) occurs when attempting to write to a filesystem mounted as read-only, often due to disk errors triggering auto-remount. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.

Here are the key things to understand: EROFS is errno 30 on Linux. The filesystem has been mounted or remounted as read-only. Linux automatically remounts filesystems read-only when disk errors are detected. Check mount status with mount | grep /partition or findmnt. dmesg log will show the reason for the remount. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.

The most common reasons this occurs include: Filesystem errors triggered automatic read-only remount. Disk hardware failure causing I/O errors. Filesystem mounted read-only intentionally in /etc/fstab. Snap or container filesystem that is inherently read-only. System in recovery mode with root mounted read-only. Identifying the root cause is the first step toward finding the right solution.

To resolve this, follow these recommended steps: Check dmesg for disk errors: dmesg | grep -i 'error\|remount\|read-only'. Remount as read-write: mount -o remount,rw /mount/point. Run filesystem check: umount /dev/sdXY && fsck -y /dev/sdXY. Check disk health with smartctl -a /dev/sdX. If hardware failure, replace the disk immediately after backing up data. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.

This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.

Quick Answer

Why did my filesystem become read-only?

Most likely the kernel detected I/O errors and remounted read-only to prevent data corruption. Check dmesg for the specific error.

Overview

Linux errno 30 (EROFS) occurs when attempting to write to a filesystem mounted as read-only, often due to disk errors triggering auto-remount.

Key Details

  • EROFS is errno 30 on Linux
  • The filesystem has been mounted or remounted as read-only
  • Linux automatically remounts filesystems read-only when disk errors are detected
  • Check mount status with mount | grep /partition or findmnt
  • dmesg log will show the reason for the remount

Common Causes

  • Filesystem errors triggered automatic read-only remount
  • Disk hardware failure causing I/O errors
  • Filesystem mounted read-only intentionally in /etc/fstab
  • Snap or container filesystem that is inherently read-only
  • System in recovery mode with root mounted read-only

Steps

  1. 1Check dmesg for disk errors: dmesg | grep -i 'error\|remount\|read-only'
  2. 2Remount as read-write: mount -o remount,rw /mount/point
  3. 3Run filesystem check: umount /dev/sdXY && fsck -y /dev/sdXY
  4. 4Check disk health with smartctl -a /dev/sdX
  5. 5If hardware failure, replace the disk immediately after backing up data

Tags

linuxerrnoerofsread-onlyfilesystem

More in Errno

Frequently Asked Questions

Most likely the kernel detected I/O errors and remounted read-only to prevent data corruption. Check dmesg for the specific error.