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

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?


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