ubuntu改密码mount -o remount,rw /无效怎么办
时间: 2023-12-03 19:05:46 浏览: 169
如果在 Ubuntu 中使用命令 `mount -o remount,rw /` 不能将文件系统重新挂载为可读写模式,你可以尝试以下方法:
1. 检查文件系统是否已经损坏。你可以使用 `dmesg` 命令查看系统日志,看是否有文件系统错误的提示信息。如果有错误,你需要修复文件系统才能重新挂载为可读写模式。你可以使用 `fsck` 命令来修复文件系统。
2. 确认你有足够的权限来修改密码。如果你不是管理员或者没有修改密码的权限,你需要以管理员身份运行命令。你可以使用 `sudo` 命令来以管理员身份运行命令。
3. 确认你的文件系统没有被加密。如果你的文件系统被加密了,你需要先解密才能重新挂载为可读写模式。
如果以上方法都不能解决你的问题,你可能需要考虑使用 Live CD 或者恢复模式来修复系统。
相关问题
ubuntu18.04 系统下面系统维护工具(如sudo mount -o remount,rw /)是否允许更改,这个如何检查,如何设置呢
在Ubuntu 18.04系统中,"sudo mount -o remount,rw /" 这个命令用于临时将根文件系统从只读(ro)改为可读写(rw),以便进行必要的修改。默认情况下,系统在启动时会以只读模式加载分区以保护数据安全,但在必要时可以手动改变权限。
检查当前挂载点权限:
```sh
$ df -hT /
```
查看"/"的挂载选项,如果看到 "ro" 字样,说明当前是只读模式。
若要永久更改,你需要编辑文件系统挂载表。在Ubuntu中,通常是编辑 `/etc/fstab` 文件。找到对应的分区行(一般为UUID或设备名),然后添加或修改 `remount` 参数。例如,如果你想将分区设置成允许读写:
```bash
# 假设你的分区是/dev/sda5,原本的行可能是这样的:
/dev/sda5 / ext4 defaults 0 1
# 添加 'remount' 参数:
/dev/sda5 / ext4 defaults,remount,noatime 0 1
```
然后保存并退出编辑器,之后可能会需要重启电脑让更改生效。注意操作前最好备份重要数据,因为修改fstab可能导致数据丢失。
cannot remount /dev/mapper/ubuntu--vg-ubuntu--lv read-write, is write-protected.
As an AI language model, I do not have the complete context of the situation. However, I can suggest some general solutions you can try:
1. Check if the file system is already mounted as read-only. You can use the "mount" command to check this. If it is mounted as read-only, try to remount it as read-write using the "mount -o remount,rw" command.
2. Check if the device is write-protected. If it is, you need to disable the write protection.
3. Check if there are any errors in the file system. You can use the "fsck" command to check and repair any errors.
4. Check if there are any issues with the storage device. It could be a hardware issue. You can try to connect the device to another machine to see if it works.
5. If none of the above solutions work, you may need to backup your data and reinstall the operating system.
Again, I would recommend seeking the help of a qualified technician if you are unsure of what to do.
阅读全文
相关推荐















