How to remount a disk that goes into read-only mode without rebooting?

7,161

Solution 1

From Linux, how to change HDD state from ReadOnly after temporarly crash? the accepted answer (with 12 upvotes, at the time of this writing) states:

try with blockdev --setrw or hdparm -r 0

Solution 2

Can you please try this:

mount -o remount,rw /dev/nvme0n1p2

It works fine for me.

If you find anything please let me know.

-Karmdip Joshi

Share:
7,161

Related videos on Youtube

Guerlando OCs
Author by

Guerlando OCs

Updated on September 18, 2022

Comments

  • Guerlando OCs
    Guerlando OCs over 1 year

    I have a kernel bug that makes my SSD go into read-only mode. To fix this I have to reboot the system, do fsck /dev/nvme0n1p2, and then reboot again to make everything work.

    Instead of doing the reboot, I tried to just do

    sudo fsck /dev/nvme0n1p2
    

    but how can I mount the nvme0n1p2 disk without rebooting? I want to work on my machine without needing to reboot.

    I tried:

    lz@blade:~$ sudo mount /dev/nvme0n1p2
    mount: /: /dev/nvme0n1p2 already mounted on /.
    

    So I tried:

    lz@blade:~$ sudo umount /dev/nvme0n1p2
    lz@blade:~$ sudo mount /dev/nvme0n1p2
    mount: /: /dev/nvme0n1p2 already mounted on /.
    

    Can somebody help me?

    • tudor -Reinstate Monica-
      tudor -Reinstate Monica- almost 5 years
      Also, disks go read-only for a reason. You should definitely look into why that's happening. syslog is your friend.
    • Pablo Bianchi
      Pablo Bianchi almost 5 years
    • Dr_Bunsen
      Dr_Bunsen almost 5 years
      Are you sure it is not the SSD going into the "I am dying" mode, making it read only so you can rescue stuff?
    • Guerlando OCs
      Guerlando OCs almost 5 years
      @Dr_Bunsen I tried another brand new SSD and the same problem happens, and also other people have this problem
  • Guerlando OCs
    Guerlando OCs almost 5 years
    sudo mount -o remount,rw /dev/nvme0n1p2 mount: /: cannot remount /dev/nvme0n1p2 read-write, is write-protected.