Why my Linux server ext3 filesystem go read-only?

by Vivek Gite · 9 comments

From my mailbag:

We have 5 Dell server collocated running CentOS 4.x and 5.x server operating system. Sometime my file system (ext3) goes read-only. I’d like to know what could be causing such a problem?

My guess:
a) Hardware problem / hard disk problem, check harddisk for errors.

b) High disk I/O aka busy I/O retry error can mark low level disk call as failed. This will force ext3 to go into read only mode.

c) High disk I/O on SAN

d) SAN is not configured properly for the path failover.

In all sort of problems ext3 goes read-only to protect the filesystem and further damage. If you are using VMWARE, check out official webpage to download SCSI patches or workaround for vmware problems.

So what could be causing the file system on Linux go read-only?

Apart from above generic problem, any other error can trigger filesystem on Linux go read only. I hope our reader / seasoned Linux admin can help to answer this question. Please share the experiences and advice in the comments.

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 9 comments… read them below or add one }

1 Chmouel Boudjnah 08.29.07 at 11:48 am

RAID going in degraded mode, the fs may detect that and the server can get in read only.

2 Abe Cheng 03.07.08 at 6:35 pm

I have similar issues with RHEL 4ES U3 or U4. Did you get this issue(s) resolved yet? Thanks.

3 Greg 03.20.08 at 4:20 pm

This is a bug in the Linux kernel. It apparently is fixed in kernels as of 2.6.22. Also, I *think* it has been back-ported to some earlier kernels. For example CentOS 5.1 (and RHEL 5.1 for that matter) supposedly have it fixed as well. I was commonly seeing it in CentOS 5 virtual machine running on VMWare. Here is their Knowledge Base article for more info.

Although that article is targeted for virtual machines, apparently the kernel bug affected Linux running on real hardware as well.

4 Erik 07.14.08 at 6:12 pm

OK, so I am having a similar problem. CentOS 4.2. Don’t ask but the following commands were executed:
chown -R 0 etc opt var
chgrp -R 0 etc opt var
chmod -R 0500 opt
chmod -R 0600 etc var

Several things stopped working… after the server was rebooted, I can log in still: root@(none) and I can even see all the etc, opt, and var data. However, when I try:
chmod -R 0755 etc

I get all sorts of changing file blah; Read-only file system. I cannot alter the permissions. Is there a way to fix this?

5 Erik 07.14.08 at 6:36 pm

I ran:
mount -o remount /

That fixed it – no longer in read-only mode. Now I can go correct the damage done.

6 Rajagopal 01.15.09 at 1:35 pm

This saved my day. I spent the last four hours trying to figure out why I always ended up in a readonly mode when boot failed. Thanks for sharing the info.

7 Fahdi 02.06.09 at 8:59 pm

@Erik
Dude you are great you saved me to reinstall OS. Great I fixed my OS.

Thank Alot.

Regards,

8 joseph 09.27.09 at 11:23 am

To become Read-only is much better than damaging the filesystem. Then what you need to do is to backup the partition followed by a fsck.

9 Sam Jas 11.26.09 at 7:42 am

Hi All,
I am frequently getting read-only file system error on my server.
We are using postgres, Grid database. The size of database is very huge.
CentOS 5.3 64 bit Areca high point rocket raid 3520 8 port
32 GB RAM
Assemble hardware.
We are daily processing millions of rows and loadiing into database. We have marked that when we create a new database it worked fine upto 20 or 25 days. After that we
are getting errors like “read only file system” , data is corrupted. Therefore we are running fsck to remove bad blocks from the disk. However, after running fsck also we are getting the same error.

I will appreciate you if somebody help me to get rid out of this issue.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: