Search This Blog

Thursday, May 27, 2010

Why does my file system gets readonly ?

The kernel will change a filesystem to read-only when it detects an I/O error against that file system. This can happen for a number of reasons:

- Your connection to your SAN dropped;

- Your hard drive(s) are dying;

- You have significant data corruption;

- and on and on...


Except for the first reason I listed, all of the other reasons are Real Bad.

If you're lucky, you've got some minor data corruption that caused the kernel to try to write beyond the end of the drive or something like that; you should try running fsck on the filesystem first. Be warned, though, that if you have significant data corruption, fsck may completely hose the filesystem, so get as good a backup as you can first.

You should check /var/log/messages for kernel messages about this. If it happens again, dmesg will also have useful information (at least, it will until you reboot).

If the problem is transient, a simple userspace mount call will fix it:
# mount -o remount,rw,usrquota /home

No comments: