Bootstrap FreeKB - Linux Commands - Resolve "Read Only File System"
Linux Commands - Resolve "Read Only File System"

Updated:   |  Linux Commands articles

Let's say something like this is being returned. In this example, the /usr/local/foo file or directory part of a read-only file system.

unable to open /usr/local/foo: Read-only file system

 

And /var/log/messages may have something like this.

~]# grep -i read-only /var/log/messages
Aug 15 15:45:36 server1 watchdog.sh[16583]: FILESYS: Mounted, Read-only ** /usr/local/foo **

 

I always start by using the mount command to see if the file system is mounted. In this example, the file system is being mounted with the rw (read write) option.

~]$ mount | grep -i method
/dev/mapper/datavg-lv_foo on /usr/local/foo type xfs (rw,relatime,seclabel,attr2,inode64,noquota)

 

Probably the most common thing that can cause a file system to be read only is if the partition has reached 100% used. The df command can be used to see how much space is being used by the partition.

~]$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/datavg-lv_foo    35G   29G  6.9G  81% /usr/local/foo

 

The find command with the -size option can be used to find files that are large, such as files greater than 1 GB.

find /usr/local/foo -type f -size +1G

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 76e8f3 in the box below so that we can be sure you are a human.