How can I mount a read-only filesystem as read-write?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL) 4, 5, 6, 7, 8, 9

Issue

  • One of my partition has been mounted as read-only. How can I make it read-write without rebooting?

  • How can I remount the root filesystem as read-write after it goes read-only?

  • My filesystem went read-only, can I remount without rebooting? / filesystem suddenly became read only, unable to write to files.

    # touch file
    touch: cannot touch `file': Read-only file system
    
    # cat /proc/mounts
    rootfs / rootfs rw 0 0
    /dev/root / ext3 ro,data=ordered 0 0
    

Resolution

To mount an already mounted filesystem in read-write option, run the following command.

# mount -o remount,rw <filesystem_path>

It is not recommended to remount a filesystem as read-write before a filesystem check (fsck/e2fsck/xfs_repair) has been performed; often a reboot may be required.

Remounting as read-write may work, however, if the filesystem remounts as read-only again, a filesystem check and reboot of the system is required. Refer to How to repair filesystem in rescue environment for Red Hat Enterprise Linux.

Root Cause

A filesystem becomes read-only to protect data. Various reasons can cause this and analysis is required to determine the cause.

Note: The above command from the resolution section does not always work. If you see something similar to the following, then rebooting the system may be your only method to have the filesystem mounted as (rw). This might require an fsck, and/or file recovery from backups:

EXT4-fs error (device dm-7): ext4_remount: Abort forced by user
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.