引导到只读文件系统

Ian*_*ong 2 boot mount read-only

我在 ssh 上将 Ubuntu Desktop(虽然我将它用作服务器)从 14.04 更新到 16.04。完成并重新启动后,它会引导到只读文件系统。

root@Server:/# touch a
touch: cannot touch 'a': Read-only file system
Run Code Online (Sandbox Code Playgroud)

我试过了mount -o remount,rw /,但输出是mount: can't find UUID=/dev/sda1. 我认为 UUID 以某种方式更改为 /dev/sda1。这是/etc/fstab 的内容。

root@Server:/# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=/dev/sda1 /               ext4    errors=remount-ro 0       1
# UUID=643d9cab-177e-4eee-a52f-224ebf0bc405 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=481bc70a-eb80-4040-93a1-696c46faa638 none            swap    sw              0       0
Run Code Online (Sandbox Code Playgroud)

我想我应该注释 UUID=/dev/sda1 行并取消注释 UUID=643d9cab-... 正下方的行,但是因为根文件系统被挂载为只读,所以我不能。我不知道这是否有帮助,但这是内核消息的一部分。

root@KrootServer:/# dmesg|grep mount
[    1.794106] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[    5.675605] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[   19.677056] cgroup: new mount options do not match the existing superblock, will be ignored
Run Code Online (Sandbox Code Playgroud)

那么我该如何解决这个问题呢?我正在尝试解决 ssh 上的问题,所以如果我需要物理访问机器,请告诉我。

[+] 结果 sudo blkid

ian0371@Server:~$ sudo blkid
/dev/sda1: UUID="643d9cab-177e-4eee-a52f-224ebf0bc405" TYPE="ext4" PARTUUID="0000e118-01"
/dev/sda5: UUID="481bc70a-eb80-4040-93a1-696c46faa638" TYPE="swap" PARTUUID="0000e118-05"`
Run Code Online (Sandbox Code Playgroud)

小智 5

我在启动到复制的根文件系统时遇到了同样的问题(我忘记在 /etc/fstab 中调整 UUID 值)。mount -o remount如果您不指定设备,结果仍然会在 /etc/fstab 中查找。它在手动指定设备时起作用:

mount -o remount,rw /dev/sda1 /
Run Code Online (Sandbox Code Playgroud)