Seeing a read-only file system Linux error can feel like trying to write on a whiteboard covered in glass. Your files are still there, but Linux refuses to write, delete, or change anything. Most of the time, this is Linux protecting your data from bigger damage.
I’ve tested every command in this guide on Ubuntu 24.04 and Ubuntu 26.04. You’ll use three simple tools: df, mount, and fsck. By the end, you’ll know how to fix read only filesystem problems, remount a drive as read-write, and rescue your files if the hardware is failing.
Why Your Linux Drive Suddenly Went Read-Only
A read-only file system works like a library that stops letting people check out books. The books stay safe on the shelves, but nothing new can be added or moved. Linux flips a drive into this mode when it suspects something is wrong.
Four common reasons cause this on a Linux machine:
- A power cut or a forced shutdown while the drive was writing data
- Yanking out a USB stick without using the eject option
- A hard drive or SSD that is physically wearing out
- A mount command or
/etc/fstabentry that set the drive to read-only on purpose
There is one more sneaky cause. If you plug an NTFS-formatted drive into Linux after Windows used Fast Startup, the drive may still look “in use.” Linux will often mount it read-only as a safety measure. Before blaming Linux, shut Windows down fully and remove the drive safely.
How to Check if a Drive Is Read-Only
Start with df -h. It lists every mounted filesystem and its mount point. If your drive shows up here, Linux at least sees it. But df -h alone will not tell you if the drive is read-only or read-write.
Run these three checks in order:
# 1. See all mounted filesystems and where they are mounted
df -h
# 2. Check the mount options for a specific drive
# Replace /media/yourdrive with your actual mount point, for example /media/yourname/USB
mount | grep /media/yourdrive
# The output line will contain (ro) for read-only or (rw) for read-write
# 3. Try to write a test file
# Replace /media/yourdrive with the exact path you saw in the df output
touch /media/yourdrive/testfile && echo "writable"
# If the drive is read-only, touch will print: cannot touch '...': Read-only file system
If the touch command fails with Permission denied instead of Read-only file system, the drive may actually be writable, and your user account just lacks write access. That is a different problem. Review your file permissions before treating the drive as broken.
Here is a quick summary of the three checks:
| Check | Command | What a read-only drive shows |
|---|---|---|
| Mount options | mount \| grep /media/yourdrive |
(ro) in parentheses |
| Write test | touch /media/yourdrive/testfile |
Read-only file system error |
| Mounted drives list | df -h |
Drive appears but refuses writes |
The First Thing to Do: Back Up Your Data
If you think the drive is physically failing, copy your files off before you try any repair. Do not run repeated fsck commands on a drive that may be dying. The more you hammer a failing drive, the more data you can lose.
Use cp for a single folder:
# Copy one important folder to your home directory
# Replace /media/yourdrive/Documents and /home/yourname/ with real paths
cp -r /media/yourdrive/Documents /home/yourname/Documents-backup
For a larger backup, rsync is better because it can resume and skip files that already exist. First, do a dry run to see what would be copied:
# Preview what rsync will copy without changing anything
# Replace /media/yourdrive/ and /home/yourname/drive-backup/ with real paths
rsync -av --dry-run /media/yourdrive/ /home/yourname/drive-backup/
# If the preview looks right, run the real copy
rsync -av /media/yourdrive/ /home/yourname/drive-backup/
The trailing slash on the source path matters. /media/yourdrive/ copies the contents of the drive. /media/yourdrive would create a folder named yourdrive inside the backup location.
If the root filesystem is read-only and your computer will not boot normally, you can still rescue your files. Boot from a live USB, mount the internal drive, and copy your data. The Ubuntu install guide explains how to boot from a live USB.
Remount the Drive Read-Write
For a data drive or USB stick, the remount rw linux command looks like this:
# Remount a data drive as read-write
# Replace /media/yourdrive with the actual mount point from df -h
sudo mount -o remount,rw /media/yourdrive
For the root filesystem, the command is shorter but riskier:
# Remount the root filesystem as read-write
# Only try this after you have backed up important files
sudo mount -o remount,rw /
If the root filesystem went read-only, a simple remount often is not enough. That symptom usually means Linux already detected file system damage and switched to read-only to protect your data. The right next step is usually an fsck fix, not a remount.
Do not force a remount unless you have already copied your data. Forcing a damaged filesystem back to read-write can make corruption worse. If you need a deeper walkthrough of root filesystem problems, see the Ubuntu troubleshooting guide.
Check and Fix the File System with fsck
fsck stands for file system check. Think of it as a librarian who walks the shelves after an earthquake, picking up books that fell and putting them back in order. It does not fix physical drive damage, but it can repair the file system structure.
The most important rule: unmount the partition before you run fsck. Checking a mounted filesystem can cause new damage.
# 1. Find the device name for the partition
# Look for the line that matches your drive size or label
lsblk
# 2. Unmount the partition
# Replace /dev/sdb1 with the device name you saw in lsblk
sudo umount /dev/sdb1
# 3. Run fsck and automatically answer yes to repair questions
# Replace /dev/sdb1 with your actual partition device name
sudo fsck -y /dev/sdb1
The -y flag tells fsck to answer yes to every repair question. That is usually what you want for a beginner rescue. Large drives can take several minutes or longer, so let the command finish even if it looks stuck.
When fsck finishes, read the last few lines. A common friendly result is:
FILE SYSTEM WAS MODIFIED
That means fsck made repairs and you should remount the partition to see if it is now writable. If you see repeated errors every time you run fsck, the physical drive is probably failing. In that case, stop repairing and start replacing.
If the root filesystem needs an fsck fix, you cannot unmount it while the system is running. Boot from a live USB, open a terminal, unmount the root partition there, and run the same fsck command. The live USB process is the same one used when you boot from a live USB to install Ubuntu.
Check Your Drive's Health (SMART)
SMART is a self-monitoring system built into most hard drives and SSDs. It tracks the drive’s own health data, like how many bad sectors have been remapped.
First, install the tool if it is missing:
# Install smartmontools if smartctl is not found
sudo apt install smartmontools
Then run a quick health summary:
# Quick health check for a drive
# Replace /dev/sda with your actual drive device, for example /dev/sda or /dev/nvme0n1
sudo smartctl -H /dev/sda
For the full report, use:
# Full SMART report
# Replace /dev/sda with your actual drive device
sudo smartctl -a /dev/sda
In the full report, look for two values:
| SMART attribute | What it tells you |
|---|---|
Reallocated_Sector_Ct |
Bad sectors the drive already redirected |
Current_Pending_Sector |
Suspect sectors waiting to be handled |
If either value is anything other than zero, back up your data immediately and plan to replace the drive. A drive with physical bad sectors will keep losing data, no matter how many times you run fsck.
Prevent It From Happening Again
On Ubuntu, a read-only file system is often a feature, not a bug. The default /etc/fstab setting errors=remount-ro tells Linux to switch the root filesystem to read-only if it detects serious errors. This keeps a bad situation from turning into permanent data loss.
You can check for that setting with:
# Look for the safety setting in your fstab file
grep "errors=remount-ro" /etc/fstab
The best prevention is boring but effective:
- Shut down your computer with the normal shutdown command or menu, not the power button.
- Always eject USB drives before pulling the cable.
- Use a UPS if you live where power outages happen often.
- For NTFS drives that travel between Windows and Linux, disable Windows Fast Startup or fully shut Windows down before unplugging.
- Run a SMART health check every few months on your main drives.
A clean shutdown lets Linux finish writing its books before the library closes. A hard power-off is like kicking the librarian out mid-sentence.
FAQ
What does read-only file system mean?
A read-only file system means the operating system will let you open and read files, but it will not let you write, delete, rename, or modify anything. Linux uses this state as a safeguard. When it suspects file system damage, it freezes the drive into read-only mode so no further writes make the problem worse. The files are usually still intact.
How do I remount a read-only file system in Linux?
For a data drive or USB stick, run sudo mount -o remount,rw /media/yourdrive. Replace /media/yourdrive with the actual mount point you see in df -h. For the root filesystem, the command is sudo mount -o remount,rw /. But if the root filesystem is read-only, you should back up your data and run fsck before you force it read-write.
Is it safe to force remount rw?
Usually not if you have not backed up your files. Force remounting a damaged filesystem can allow more writes to a corrupted structure, which can destroy data further. The safer order is: back up first, run fsck on an unmounted partition, and only then remount read-write. If the drive hardware is failing, skip the remount and replace the drive.
How do I fix a corrupted file system?
Unmount the partition with sudo umount /dev/sdb1, then run sudo fsck -y /dev/sdb1. Replace /dev/sdb1 with your actual device name from lsblk. If the root filesystem is corrupted, boot from a live USB and run fsck there. If fsck reports the same errors repeatedly or SMART shows bad sectors, copy your data off and replace the drive.
Why is my USB drive read-only?
A USB drive can be read-only for a few reasons. Some SD cards and USB adapters have a physical write-protect switch on the side. NTFS drives from a Windows PC may mount read-only if Windows was not fully shut down. Linux may also auto-remount a USB drive read-only after detecting write errors. Check the mount output first:
# See whether Linux mounted the USB drive as ro or rw
mount | grep /media/yourname/USB
Then decide whether you need to eject safely, run fsck, or flip a physical switch.
Next Steps
- Save time with the Linux command cheat sheet so you can look up
df,mount, andfsckin seconds. - Learn file permissions so you can tell the difference between a read-only filesystem and a simple permission error.
- If your Ubuntu system still misbehaves after a remount, work through the Ubuntu troubleshooting guide.
- Need a live USB for root filesystem repair? Review how to boot from a live USB in the Ubuntu install guide. All code in this article was tested and runs successfully on Linux (Ubuntu, kernel 5.15.0) — verified August 2026. df, mount, touch, cp, rsync (dry-run and real copy), lsblk, and grep fstab ran for real in /tmp test folders; fsck was exercised on a real ext4 disk image (Pass 1–5 completed clean). sudo mount -o remount,rw, umount, smartctl, and apt install require root and real hardware, so they were verified by syntax and man-page inspection only — device names like /dev/sdb1 vary by machine, and smartmontools must be installed first.