Skip to main content
“Read-only file system” means Linux refuses to write to that filesystem. Usually the kernel switched it to read-only after detecting disk or filesystem errors, to stop further damage. Check with findmnt -no OPTIONS / and sudo dmesg | grep -iE 'error|read-only'. If errors show, back up first, then repair with fsck from rescue mode. If it was mounted read-only on purpose, sudo mount -o remount,rw / makes it writable again.

Before you start

  • While the filesystem is read-only, logs, databases and package updates can’t write. Don’t keep restarting services: find the cause first.
  • If the cause is disk errors, copy important data off before you try any fix. A read-only filesystem can still be read.
  • Commands use sudo. As root, leave it out.

Step 1: Confirm which filesystem is read-only

ro at the start of the options confirms it. Replace / with the folder that fails (for example /var or /data) if it’s a separate mount.

Cause 1: The kernel found errors and protected the disk

On Ubuntu and Debian, the root filesystem is usually mounted with errors=remount-ro: when ext4 finds an inconsistency, it switches to read-only instead of carrying on. A crash, a forced power-off or a failing disk can trigger it. Check:
Lines such as EXT4-fs error (device vda1) or I/O error, dev vda confirm it. On XFS (AlmaLinux and Rocky), the filesystem shuts down instead, and writes fail with Input/output error. Fix:
1

Back up what you need

Copy databases and files to another machine while you still can read them, for example with rsync. Nothing can be saved on the read-only disk itself, so send copies straight to the other machine.
2

Repair from rescue mode

Start rescue mode, find the disk with lsblk -f, and repair it without mounting it:
Use the device name from lsblk.
3

Boot normally

End the rescue session and check the options again with findmnt -no OPTIONS /.
Don’t run e2fsck or xfs_repair on a mounted filesystem, and don’t force it writable with mount -o remount,rw while disk errors are still appearing. Both can turn a repairable fault into lost data.
If the errors come back after a repair, the storage itself may be failing. On a VPS, open a ticket with the dmesg lines. On a dedicated server, check the drives with smartctl and open a ticket.

Cause 2: It was mounted read-only on purpose

Someone (or a script) mounted it with ro, or /etc/fstab says so. dmesg then shows no errors. Check:
Look for ro in the options column of the affected mount. Fix: remount it writable now:
To make it permanent, change ro to defaults (or remove ro) in /etc/fstab, then run sudo findmnt --verify.

Cause 3: Only one service sees it read-only

If the shell can write but a service logs Read-only file system, systemd’s sandboxing is the likely reason. Units with ProtectSystem=strict (or full) see /usr, /etc or the whole system as read-only. Check:
Fix: allow the folders the service really needs:
Then run sudo systemctl restart myapp. In Docker, the same error means a volume is mounted with :ro or the container uses --read-only.

How to check it worked

Frequently asked questions

Will a reboot fix it?

A reboot runs the automatic check, which fixes small problems, so the server may come back writable. If the errors were serious, it can stop at boot instead: see Linux server won’t boot. Back up before you reboot.

Is “Read-only file system” the same as “Permission denied”?

No. “Permission denied” is about your user’s rights on one file. “Read-only file system” blocks everyone, root included.

Can a full disk cause this?

No. A full disk gives No space left on device. Read-only is a mount state.

VPS and dedicated server guides

Every guide in this section.

Linux server won't boot

Emergency mode and fsck at boot.

Check disk health

SMART checks on dedicated servers.

Back up a Linux server

Get your data off safely.

No space left on device

The other common write error.

Checked against the official ext4 kernel documentation (errors= mount option), the mount, e2fsck and xfs_repair manuals and the systemd systemd.exec manual on 4 November 2026; the read-only error, findmnt output, mount -o remount,rw and offline e2fsck / xfs_repair runs were tested on loop-device filesystems on Ubuntu 24.04 LTS. The systemd sandbox fix was not tested.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026