Ubuntu – Booting into read-only file system

bootmountread-only

I updated Ubuntu Desktop(although I'm using it as a server) from 14.04 to 16.04 on ssh. After completion and rebooting, it boots into read-only file system.

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

I tried mount -o remount,rw /, but the output is mount: can't find UUID=/dev/sda1. I think UUID is somehow changed to /dev/sda1. This is the contents of /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

I think I should comment the line UUID=/dev/sda1 and uncomment the line UUID=643d9cab-… right below, but because the root file system was mounted as read-only, I couldn't. I don't know if this would help, but here's a part of kernel message.

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

So how do I fix this problem? I'm trying to fix the problem on ssh, so let me know if I need to physically access the machine.

[+] result of 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"`

Best Answer

Now lets try this fix:

  1. Boot into recovery mode
  2. Select root from recovery menu.
  3. Mount file system with:

    mount -o remount,rw /
    
  4. Using vim or nano change your /etc/fstab like so:

    #UUID=/dev/sda1 /               ext4    errors=remount-ro 0       1
    UUID=643d9cab-177e-4eee-a52f-224ebf0bc405 /               ext4    errors=remount-ro 0       1
    
  5. Then exit and select resume from recovery menu, that should fix your issue.

Related Question