ubuntu改密码mount -o remount,rw /无效怎么办
时间: 2023-12-03 16:05:46 浏览: 82
如果在 Ubuntu 中使用命令 `mount -o remount,rw /` 不能将文件系统重新挂载为可读写模式,你可以尝试以下方法:
1. 检查文件系统是否已经损坏。你可以使用 `dmesg` 命令查看系统日志,看是否有文件系统错误的提示信息。如果有错误,你需要修复文件系统才能重新挂载为可读写模式。你可以使用 `fsck` 命令来修复文件系统。
2. 确认你有足够的权限来修改密码。如果你不是管理员或者没有修改密码的权限,你需要以管理员身份运行命令。你可以使用 `sudo` 命令来以管理员身份运行命令。
3. 确认你的文件系统没有被加密。如果你的文件系统被加密了,你需要先解密才能重新挂载为可读写模式。
如果以上方法都不能解决你的问题,你可能需要考虑使用 Live CD 或者恢复模式来修复系统。
相关问题
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.
ubuntu修改root密码命令
根据提供的引用内容,可以使用以下两种方法修改Ubuntu的root密码:
方法一:使用sudo命令修改root密码
1. 打开终端并输入以下命令以使用sudo命令切换到root用户:
```shell
sudo su
```
2. 输入以下命令以更改root用户的密码:
```shell
passwd root
```
3. 输入新密码并确认。
方法二:在GRUB中修改kernel镜像启动参数
1. 重启计算机并在启动时按下Shift键,以进入GRUB菜单。
2. 选择Ubuntu内核并按下“e”键以编辑启动参数。
3. 找到以“ro quiet splash”结尾的行,并将其替换为以下内容:
```shell
rw init=/bin/bash
```
4. 按下Ctrl + X以启动计算机并进入单用户模式。
5. 输入以下命令以挂载文件系统:
```shell
mount -o remount,rw /
```
6. 输入以下命令以更改root用户的密码:
```shell
passwd root
```
7. 输入新密码并确认。
8. 输入以下命令以重新挂载文件系统:
```shell
mount -o remount,ro /
```
9. 输入以下命令以重启计算机:
```shell
reboot
```