Re: [Jfs-discussion] Detecting when device has been remounted read-only from userspace
Brought to you by:
blaschke-oss,
shaggyk
From: Dave K. <sh...@li...> - 2007-05-10 16:36:32
|
On Thu, 2007-05-10 at 09:57 -0400, Daniel Drake wrote: > Hi, > > Occasionally, JFS detects filesystem corruption during use and and > remounts the filesystem read-only. (the corruption is probably warranted > for, e.g. unexpected power loss happened some time previously) jfs really should recover cleanly after a power loss, but caching by the disk drives can undermine the journal's integrity. There may be some undiscovered bugs as well. If there are no i/o errors on the device, file-system corruption should be a pretty rare occurrence. > Is there a clean way to detect when this happens from userspace, other > than checking every single I/O operation? In our case, we'd like to pop > up a warning and recommend a reboot. jfs prints a message to the system log when this happens, so maybe you could somehow monitor that? The message contains "remounting filesystem as read-only". I guess another method might be to occasionally check the mount point in /proc/mounts to see if it is mounted read only ("ro" rather than "rw"). Shaggy -- David Kleikamp IBM Linux Technology Center |