Operations 4 min read

Fixing a Read‑Only Ubuntu Filesystem After LNMP Installation: Step‑by‑Step Guide

After installing multiple LNMP services, a reboot left the Ubuntu system unable to run apt update due to a read‑only filesystem caused by a missing /etc/fstab, and this guide walks through diagnosing the issue, restoring fstab with correct UUIDs, remounting the root, and backing up the configuration.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Fixing a Read‑Only Ubuntu Filesystem After LNMP Installation: Step‑by‑Step Guide

On September 15, 2024, after installing multiple LNMP services, a system reboot caused the apt update command to fail with DNS resolution errors and a read‑only file system.

Running df -h showed that the /mnt/data mount point was missing, and /etc/fstab was empty, which likely caused the read‑only state.

Resolution steps:

Check the file system: sudo fsck /dev/sda3 Result: /dev/sda3 has no issues.

Remount the root filesystem as read‑write: sudo mount -o remount,rw / Test file creation: sudo touch /testfile Obtain UUIDs with blkid : sudo blkid Edit and restore /etc/fstab using the UUID information:

# Root filesystem
UUID=xxxxxxxxxxxxxxx   /   ext4    defaults    0   1
# Boot partition
UUID=xxxxxxxxxxx    /boot/efi    vfat    defaults    0    2
# RAID array
UUID=xxxxxxxxx   /mnt/data   ext4   defaults   0   2

Backup the new /etc/fstab :

sudo cp /etc/fstab /etc/fstab.$(date +%F_%T).bak

In summary, the missing /etc/fstab caused the filesystem to become read‑only; restoring it with correct UUIDs and remounting resolved the issue, and a dated backup was created to prevent recurrence.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxtroubleshootingFilesystemUbuntuLNMPfstab
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.