Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Fix Read-Only File System & Format to Read-Write

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

When a drive or partition becomes read-only, you can no longer write, edit, or delete files on it. This guide walks you through identifying why the file system is read-only, remounting it as read-write, and if needed, formatting the drive to a read-write capable file system. You'll need administrative access to your computer and a backup of any important data before proceeding.

What You'll Need

  • Administrator or root access to your computer
  • Backup of any important data on the affected drive
  • For Linux: a terminal and the mount and umount commands
  • For Windows: the Disk Management tool or Command Prompt
  • For macOS: Disk Utility or Terminal

Step-by-Step

  1. Identify the file system and mount status.
    • Linux: Run lsblk -f to see your drives and their file system types (e.g., ext4, NTFS, FAT32). Look for the mount point and whether it's listed as read-only (often shown as ro).
    • Windows: Open Disk Management (right-click Start → Disk Management). Check if the volume has a file system and if it's healthy or shows errors.
    • macOS: Open Disk Utility and select the volume to see its format and mount status.
  2. Unmount the drive. You cannot change mount options while the drive is in use.
    • Linux: sudo umount /dev/sdX (replace sdX with your device, e.g., sdb1).
    • Windows: In Disk Management, right-click the volume and choose "Change Drive Letter and Paths" → Remove. Or use mountvol command to unmount.
    • macOS: In Disk Utility, click the Unmount button.
  3. Remount as read-write.
    • Linux: Use sudo mount -o remount,rw /dev/sdX /mountpoint (or just sudo mount -o rw /dev/sdX /mountpoint). If the file system is corrupted, this may fail; you'll need to run a filesystem check first (see step 4).
    • Windows: If the drive is NTFS, it may be read-only due to a dirty bit. Open Command Prompt as Administrator and run chkdsk /f X: (replace X with the drive letter). This will fix errors and allow read-write access.
    • macOS: In Disk Utility, select the volume and click "Mount" (if it's unmounted). If it's read-only due to permissions, run sudo mount -o remount,rw /Volumes/YourDrive in Terminal.
  4. Check and repair the file system if needed. A read-only state often indicates corruption.
    • Linux: Run sudo fsck -f /dev/sdX (make sure it's unmounted first). This will scan and fix errors.
    • Windows: Run chkdsk /f /r X: (as above).
    • macOS: Run fsck -fy in Recovery Mode (boot with Command+R, open Terminal).
  5. Format the drive to a read-write file system. If the file system is inherently read-only (e.g., ISO9660) or too corrupted to repair, formatting is the solution. This erases all data.
    • Linux: Use sudo mkfs.ext4 /dev/sdX (or mkfs.ntfs, mkfs.vfat). Make sure you've unmounted it first.
    • Windows: In Disk Management, right-click the volume → "Format". Choose a file system like NTFS or exFAT, set the allocation unit size (default is fine), and check "Quick Format" if you want speed.
    • macOS: In Disk Utility, select the volume → "Erase". Choose a format: APFS (for SSDs), Mac OS Extended (Journaled), or exFAT (for cross-platform).
  6. Remount the drive. After formatting, the drive should automatically mount as read-write. If not, repeat step 3.

Common Mistakes

  • Forgetting to unmount before running fsck or formatting – this can cause data loss or further corruption.
  • Using the wrong device identifier (e.g., /dev/sda instead of /dev/sdb) – double-check with lsblk or Disk Management.
  • Formatting the wrong drive – always verify the drive letter or device name, especially if you have multiple drives.
  • Ignoring the dirty bit on Windows – if chkdsk says the drive is dirty, you must run it to clear it, otherwise the drive will remain read-only.
  • Assuming all file systems support read-write – ISO9660 (CDs) and some read-only partitions (like system recovery) are designed to be read-only.

Tips

  • Back up before any repair or format. Even fsck can cause data loss if the drive is severely damaged.
  • Use the correct file system for your use case: NTFS for Windows-only, exFAT for cross-platform with large files, ext4 for Linux.
  • If the drive is an external USB, try a different port or cable – sometimes a faulty connection causes read-only mounting.
  • On Linux, check the mount options in /etc/fstab – if it says ro, change it to rw and reboot.
  • For SD cards and USB sticks, the write-protect switch may be on – physically check the card or stick for a small switch.

Troubleshooting

  • Remount fails with "device is busy": Close any programs using the drive, or use sudo lsof +f -- /mountpoint to find and kill the process.
  • fsck reports errors but can't fix them: The drive may be physically failing. Try a different machine, or consider data recovery software before formatting.
  • Windows chkdsk says "Access denied": Run it as Administrator, and make sure the drive letter is correct.
  • Drive still read-only after formatting: On Linux, check if the drive is mounted with ro in mount output; if so, remount with rw. On Windows, check if the drive is set to read-only in Diskpart (run diskpart, select volume X, attributes volume clear readonly).
  • macOS shows "The disk is locked": Click "Get Info" on the drive in Finder, uncheck "Locked", or use sudo chflags -R nouchg /Volumes/YourDrive.

Frequently Asked Questions

Why did my drive become read-only?

Common causes include file system corruption, a dirty bit (Windows), hardware write-protect switches, or the file system being mounted with read-only options (e.g., due to errors during boot).

Will formatting erase my data?

Yes, formatting erases all data on the drive. Always back up first. If you need to recover data, use data recovery software before formatting.

Can I fix a read-only file system without formatting?

Often yes. Running fsck (Linux/macOS) or chkdsk (Windows) can repair the file system and allow read-write access. Only format if these repairs fail.

What file system should I use for a USB drive to be read-write on both Windows and Mac?

exFAT is the best cross-platform choice. NTFS is read-only on macOS by default (unless third-party drivers are installed), and HFS+ is not natively supported on Windows.

Why is my SD card read-only even after formatting?

Check the physical write-protect switch on the side of the card. If it's enabled, slide it to the unlocked position. If it's still read-only, the card may be failing and should be replaced.

Is it safe to run fsck on a mounted drive?

No, always unmount the drive first. Running fsck on a mounted drive can cause data corruption.