30-second fix: remount the volume read-write
What's actually happening here is that the kernel marked the filesystem as read-only — usually because it detected a write error or the device was mounted with the ro flag by default (common on SD cards and USB drives).
Do this first:
sudo mount -o remount,rw /dev/sdXY /path/to/mountpoint
Replace /dev/sdXY with your actual device (run lsblk to find it) and /path/to/mountpoint with where it's mounted. If that works, you're done — the device was just mounted read-only by accident. This is common on Ubuntu 22.04 with auto-mounted USB drives that don't get proper rw flags from udisks.
If the command fails with mount: cannot remount ... read-write, is write-protected, the kernel has forced the filesystem to read-only because it hit an I/O error. Move to step 2.
5-minute fix: check and repair filesystem corruption
The kernel always remounts a filesystem as read-only when it encounters a write error it can't recover from. This is a safety mechanism — it prevents you from writing more data on top of a corrupted structure, which would make recovery harder. The reason step 3 works here is that fsck can often fix the underlying corruption and then you can remount normally.
First, unmount the volume so fsck can safely touch it:
sudo umount /dev/sdXY
If it says target is busy, run lsof /path/to/mountpoint to see which process is holding it. Kill that process (or close the file manager) and retry.
Now run a filesystem check. For ext4 (most Linux native drives):
sudo fsck -f /dev/sdXY
The -f flag forces a check even if the filesystem looks clean. Let it attempt repairs — type y when prompted. After it finishes, mount the drive again:
sudo mount -o rw /dev/sdXY /path/to/mountpoint
If it mounts read-write without errors, the corruption was the cause. You're fine now. But if it goes back to read-only within minutes, or fsck found a ton of errors, your disk is probably dying. Move to step 3.
For NTFS drives (common from dual-boot Windows setups), use ntfsfix instead:
sudo ntfsfix /dev/sdXY
NTFS is more fragile here — Windows' fast startup feature can leave the filesystem in a state Linux interprets as corrupted. Disable fast startup in Windows to avoid this long-term.
15+ minute fix: scan for bad sectors and replace the drive
If you've gotten this far, the filesystem keeps going read-only because the disk hardware is actually failing. The kernel isn't being paranoid — it's reacting to real I/O errors from the device firmware. This is especially common on cheap USB flash drives, SD cards (Raspberry Pi users, I'm looking at you), and older spinning hard drives.
First, check SMART data if it's an internal drive:
sudo smartctl -a /dev/sdX
Look for Reallocated_Sector_Ct, Current_Pending_Sector, and Uncorrectable_Sector_Ct. Any non-zero values here mean the drive is failing and should be replaced. Back up your data immediately — the drive will die completely, and you can't fix bad sectors.
For USB drives and SD cards, SMART often isn't available. Instead, do a destructive read-write test with badblocks. Unmount the drive first, then:
sudo badblocks -wsv /dev/sdX
The -w flag does a destructive write test — this will erase all data on the drive. The -s flag shows progress, -v is verbose. If badblocks finds any errors, the drive is failing and must be replaced. Don't bother trying to work around the bad sectors — you'll just lose more data later.
If badblocks completes without errors, the problem might be the USB port, cable, or enclosure. Try a different port (USB 3.0 vs 2.0 matters), a different cable, or a different machine. On Raspberry Pi 4 and 5, the USB power delivery is marginal — use a powered USB hub or an SSD instead of an SD card.
One more thing: if the drive is a microSD card in a USB adapter, those adapters are notoriously flaky. Pop the card directly into a computer's SD slot if available, or try a different adapter.
Why this happens and how to avoid it
The Linux kernel's read-only remount is a deliberate design choice. It trades convenience for data safety. Microsoft Windows often hides write errors behind a layer of caching and retries, so you never see them until it's too late — and then you get a corrupted filesystem. Linux shows you the error immediately by flipping the mount to read-only. It's annoying, but it gives you a chance to recover your data before the disk dies completely.
To avoid this in the future:
- Use reliable storage — Samsung or SanDisk for SD cards, WD or Seagate for HDDs, Samsung or Crucial for SSDs. Cheap no-name drives fail fast.
- Don't yank USB drives without unmounting. The kernel buffers writes in memory; pulling the drive before the buffer flushes causes corruption.
- Set the filesystem to noatime in
/etc/fstabif it's a drive that gets heavy read/write traffic (like a media server disk). Thenoatimeoption skips updating access timestamps, reducing write operations by a surprising amount. - Run
fsckperiodically. Schedule it once a month with a cron job or systemd timer. Catching corruption early keeps it from escalating.
That's it. You should now have a writeable filesystem again. If the drive is failing, don't keep using it — replace it. A few dollars now beats losing your data later.