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

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

April 14, 2023

0x80244010 Exceeded Max Server Round Trips: Windows Update...

April 12, 2023

Find Out Which Process is Listening on a...

April 5, 2023

Attaching Host USB Devices to WSL or Hyper-V...

March 20, 2023

Print Screen Key Not Working in Windows

March 17, 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

  • Configuring Event Viewer Log Size on Windows

    May 24, 2023
  • How to Detect Who Changed the File/Folder NTFS Permissions on Windows?

    May 24, 2023
  • Enable Single Sign-On (SSO) Authentication on RDS Windows Server

    May 23, 2023
  • Allow Non-admin Users RDP Access to Windows Server

    May 22, 2023
  • How to Create, Change, and Remove Local Users or Groups with PowerShell?

    May 17, 2023
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows

    May 16, 2023
  • View Success and Failed Local Logon Attempts on Windows

    May 2, 2023
  • Fix: “Something Went Wrong” Error When Installing Teams

    May 2, 2023
  • Querying Windows Event Logs with PowerShell

    May 2, 2023
  • Configure Windows LAPS (Local Administrator Passwords Solution) in AD

    April 25, 2023

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • 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?
  • How to Fix the ‘Too Many Open Files’ Error in Linux?
  • Adding Trusted Root Certificates on Linux
  • Installing PowerShell Core on Linux Distros
Footer Logo

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


Back To Top