引导到只读文件系统

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

root@Server:/# touch a touch: cannot touch 'a': Read-only file system 

我试过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). # #       # / 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 

我想我应该注释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 

那么我该如何解决这个问题呢? 我正在尝试修复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"` 

现在让我们尝试这个修复:

  1. 启动进入恢复模式
  2. 从恢复菜单中选择root
  3. 挂载文件系统:

     mount -o remount,rw / 
  4. 使用vim或nano更改/etc/fstab如下:

     #UUID=/dev/sda1 / ext4 errors=remount-ro 0 1 UUID=643d9cab-177e-4eee-a52f-224ebf0bc405 / ext4 errors=remount-ro 0 1 
  5. 然后退出并从恢复菜单中选择恢复 ,这应该可以解决您的问题。

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

 mount -o remount,rw /dev/sda1 / 

你的/ etc / fstab有问题。

 UUID=/dev/sda1 / ext4 errors=remount-ro 0 1 # UUID=643d9cab-177e-4eee-a52f-224ebf0bc405 / ext4 errors=remount-ro 0 

第一行是错误的,/ dev / sda1不是uuid。 第二行看起来是正确的。 将#放在第一行的前面,然后在下面的行中删除它。

您可以通过blkid /dev/sda1validationUUID ..如果它不同,请更改/ etc / fstab中的一个以使其匹配。

或者您可以删除/ dev / sda1前面的UUID =