Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

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

April 7, 2023 LinuxQuestions and Answers

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
previous post
Send from Alias (SMTP Proxy Address) in Exchange Online (Microsoft 365)
next post
Send Outlook Emails Using Excel VBA Macro or PowerShell

Related Reading

How to Increase Size of Disk Partition in...

October 5, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

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

August 30, 2023

How to Install and Configure Ansible on Linux

August 27, 2023

Computer Doesn’t Turn Off After Shutting Down Windows...

August 26, 2023

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

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
  • How to Access VMFS Datastore from Linux, Windows, or ESXi
  • Using iPerf to Test Network Speed and Bandwidth
  • Installing an Open Source KMS Server (Vlmcsd) on Linux
  • How to Enable Two-Factor Authentication (2FA) for SSH on Linux
  • Installing PowerShell Core on Linux Distros
Footer Logo

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


Back To Top