📌  相关文章
📜  删除 usb ubuntu 中的写保护 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:39.632000             🧑  作者: Mango

代码示例1
Unmount it, and make it writeable

sudo umount /dev/sdb1
sudo hdparm -r0 /dev/sdb
Create a new mount point and mount it there (my userID from /etc/passwd is 1000)

sudo mkdir /media/andrew/temp
sudo mount -o uid=1000 /dev/sdb1 /media/andrew/temp
it'll still complain that it's read-only. I don't know why I had to change this flag before AND after mounting, but that's the only way it worked for me. Set it to writeable again, and remount it at the same place

sudo hdparm -r0 /dev/sdb1
sudo mount -o remount,rw /dev/sdb1
Now I can write to the disk as my normal user. I'm being very careful with it in case it is actually failing, but those commands allowed me to finish what I was doing.