![Ubuntu 无需重启即可重新挂载已更改为 ro 的根挂载](https://linux22.com/image/654808/Ubuntu%20%E6%97%A0%E9%9C%80%E9%87%8D%E5%90%AF%E5%8D%B3%E5%8F%AF%E9%87%8D%E6%96%B0%E6%8C%82%E8%BD%BD%E5%B7%B2%E6%9B%B4%E6%94%B9%E4%B8%BA%20ro%20%E7%9A%84%E6%A0%B9%E6%8C%82%E8%BD%BD.png)
由于errors=remount-ro
底层 NFS 故障导致我的根挂载被重新挂载为只读。我知道没有什么问题需要我担心。如何在不重新启动服务器的情况下将其重新挂载为 rw?
一些测试:
simon@steve:~$ sudo hdparm -r /dev/sda1
/dev/sda1:
readonly = 0 (off)
simon@steve:~$ sudo blockdev --setrw /dev/sda1
simon@steve:~$ sudo blockdev --setrw /dev/sda
simon@steve:~$ sudo hdparm -r /dev/sda1
/dev/sda1:
readonly = 0 (off)
simon@steve:~$ sudo hdparm -r /dev/sda
/dev/sda:
readonly = 0 (off)
simon@steve:~$ sudo mount -o remount,rw /
mount: cannot remount block device /dev/sda1 read-write, is write-protected
答案1
mount -o remount,rw /mountpoint