Re: [Jfs-discussion] Detecting when device has been remounted read-only from userspace
Brought to you by:
blaschke-oss,
shaggyk
From: William M. <bm...@us...> - 2007-05-10 17:21:12
|
Shaggy wrote on 05/10/2007 11:36:14 AM: > 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". There are a couple of tools like swatch that will watch /var/log/messages and then take actions. And you probably don't need to reboot. You can: fsck /home mount -o remount,rw /home Bill |