einfra logoDocumentation
How-to guides

Recovering from Read-Only Root Filesystem

A virtual machine (VM) may encounter a situation where its root filesystem (/) becomes mounted in read-only (ro) mode, preventing system changes and causing services to fail.

1. Check Current Mount Status

mount | grep " / "

2. Remount the Root Partition as Read-Write

sudo mount -o remount,rw /

Verify the change:

mount | grep " / "

3. Verify Hostname Configuration

Make sure /etc/hostname and /etc/hosts are consistent.

cat /etc/hostname
cat /etc/hosts

4. Check /etc/fstab Configuration

cat /etc/fstab

If the file does not exist, recreate it with the following default content:

LABEL=cloudimg-rootfs   /          ext4   discard,errors=remount-ro   0 1
LABEL=UEFI              /boot/efi  vfat   umask=0077                  0 1

When disks look like this:

$ lsblk -a -o NAME,SIZE,TYPE,LABEL,UUID,MOUNTPOINTS
NAME      SIZE TYPE LABEL           UUID                                 MOUNTPOINTS
sda        80G disk
├─sda1   79.9G part cloudimg-rootfs 35676d47-f2e1-4e9a-9829-69227fae0c7e /
├─sda14     4M part
└─sda15   106M part UEFI            2958-59D9                            /boot/efi
sr0       486K rom  config-2        2023-01-17-15-10-53-00

Last updated on

publicity banner

On this page

No Headings
einfra banner