Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Linux / Fixing the Read-Only File System Error on Linux

April 7, 2023

Fixing the Read-Only File System Error on Linux

In some cases, the file system in Linux can switch to a read-only mode. This means that you can only read data from the hard disk, and when you try to write any changes or create a new file, you get an error saying that the file system is read-only.

File System Errors and the Remount-ro Option

Check the disk mounting options used when booting Linux

First, check the disk mount settings for the Linux startup. You will find the file system mount options in the /etc/fstab.

$ cat /etc/fstab

fstab remount read only on error

Note that the fstab file contains a line to mount the root directory, like this one here:

UUID=00000000-0000-0000-0000-00000000 / ext4 errors=remount-ro 0 1

The errors=remount-ro parameter means that the specific device will be mounted in the read-only mode in case there are problems detected on the device’s file system. In this case, you must use FSCK to perform the disk check.

Common file systems such as EXT4/BTRFS/XFS can be mounted as read-only or read-write, unlike ISO or SquashFS file systems which are read-only.

If errors are found on the disk, you can use one of the three options errors=[continue|remount-ro|panic] :

  • continue – ignore the errors,
  • remount-ro – remount the disk in read-only mode;
  • panic – halt the system.

You can map the UUID of the drive to the name of the device with the command:

$ sudo blkid

In this example, you will see that your UUID corresponds to the device /dev/sda3.

map uuid to device name in linux

Another way to get device names and mount points is to use the command

$ df –h

df - show filesystem and mount point

In this example, the errors are detected in the root directory, which is the mount point. That’s why the only way to check it is to boot your computer from the LiveCD. Use the following command to fix file system errors:

$ sudo fsck –y /dev/sda3

Or

$ sudo fsck –y UUID=00000000-0000-0000-0000-00000000

If you cannot check the disk right now and want to switch the file system out of read-only mode immediately, then run the command:

$ sudo mount -o remount,rw /

Be sure to schedule a file system check in the near future.

Read-only File System on Virtual Machines

If your external shared storage (storage array) is unavailable, the file system of the Linux partition in the virtual machine becomes read-only.

You may find that your Linux VM fails to boot at all, and all you have is the initramfs command line with a warning:

UNEXPECTED INCONSISTENCY: RUN fsck MANUALLY.
Fsck exitrd with code 4.
The root file system of /dev/sdx requires a manual fsck.

initramfs - run fsck manually

Initramfs is the tmpfs-based initial file system in RAM, which contains the tools and scripts for managing disks, file systems, etc. After entering the initramfs, you will get an error message.

If there are no errors, just type exit. Otherwise, run a disk check:

$ fsck /dev/sda3 –y

Specify the volume you want to check manually (in our case, it’s /dev/sda3).

Use the command below to check all connected file systems:

$ fsck –A –y

Then reboot the VM.

0 comment
0
Facebook Twitter Google + Pinterest
LinuxQuestions and Answers
previous post
Send from Alias (SMTP Proxy Address) in Exchange Online (Microsoft 365)
next post
0x80244010 Exceeded Max Server Round Trips: Windows Update Error

Related Reading

Fixing ‘The Network Path Was Not Found’ 0x80070035...

August 31, 2023

How to Fix the ‘Too Many Open Files’...

March 13, 2024

How to Use Ansible to Manage Windows Machines

March 12, 2024

Recovering Files from BitLocker Encrypted Drive

March 13, 2024

Using iPerf to Test Network Speed and Bandwidth

March 12, 2024

How to Access VMFS Datastore from Linux, Windows,...

March 11, 2024

Turn Linux Computer into Wi-Fi Access Point (Hotspot)

March 11, 2024

How to Increase Size of Disk Partition in...

March 11, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
  • Recovering Files from BitLocker Encrypted Drive
  • Installing an Open Source KMS Server (Vlmcsd) on Linux
  • How to Access VMFS Datastore from Linux, Windows, or ESXi
  • Install Any OS from ISO Image over Network with iVentoy
  • Using iPerf to Test Network Speed and Bandwidth
  • Moving WSL to Another Drive in Windows
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top