当我打开电脑时,收到以下错误消息:
After logging in, type "journalctl -xb" to view system logs
'systemctl 1 reboot' to reboot, 'systemctl 1 default'
or ^D to try again to boot into default mode.
输出journalctl -xb
如下
其中红色的部分我认为是导致紧急模式的原因。
我是 Ubuntu 新手。我正在使用 Ubuntu 16.04。
的输出cat /etc/fstab
如下:
当我运行命令时vim /etc/fstab
我收到了此消息。
325: ATTENTION
Found a swap file by the name "/etc/.fstab.swp"
owned by: root dated: Tue Sep 12 18:39:36 2017
file name: /etc/fstab
modified: YES
user name: root host name: pavan-desktop
process ID: 4439
[not usable on this computer]
While opening file "/etc/fstab"
dated: Mon Sep 11 19:21:36 2017
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/fstab"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/.fstab.swp"
to avoid this message.
Swap file "/etc/.fstab.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
Swap file "/etc/.fstab.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
Swap file "/etc/.fstab.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
答案1
发生这种情况是因为您的系统出于某种原因附加了/dev/sr0
该/etc/fstab
文件。您需要禁用此项。
- 通过恢复模式启动计算机并进入root选项;
- 键入
mount -o remount, rw /
以允许对 / 文件夹具有写权限; - 编辑
/etc/fstab
并评论引用/dev/sr0;
- 保存此文件并重新启动系统。