xfs
[Top] [All Lists]

Re: XFS filesystem corruption

To: Martin Steigerwald <Martin@xxxxxxxxxxxx>
Subject: Re: XFS filesystem corruption
From: Stan Hoeppner <stan@xxxxxxxxxxxxxxxxx>
Date: Tue, 12 Mar 2013 17:16:24 -0500
Cc: xfs@xxxxxxxxxxx, Julien FERRERO <jferrero06@xxxxxxxxx>, Ric Wheeler <rwheeler@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <201303121142.13980.Martin@xxxxxxxxxxxx>
References: <CAPcwv6wZJSBtgF-L6KNSn6N6Y+wUZJFXdbcg+zYRwoaB2sDdjw@xxxxxxxxxxxxxx> <5137CD46.6070909@xxxxxxxxxx> <5139A3B6.3040805@xxxxxxxxxxxxxxxxx> (sfid-20130308_132012_037479_915CAB49) <201303121142.13980.Martin@xxxxxxxxxxxx>
Reply-to: stan@xxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4
On 3/12/2013 5:42 AM, Martin Steigerwald wrote:
> Am Freitag, 8. März 2013 schrieb Stan Hoeppner:
>> If the techs are determined to hard cut power because they don't have
>> the time or the knowledge to do a clean shutdown, it may be well worth
>> your time/effort to write a script and teach the field techs to execute
>> it, before flipping the master switch.  Your simple script would run as
>> root, or you'd need to do some sudo foo within, and would contain
>> something like:
>>
>> #! /bin/sh
>> sync
>> echo 2 > /proc/sys/vm/drop_caches
>> echo "Ready for power down."
> 
> mount -o remount,ro /your/mount/point
> 
> One can at least try. Maybe some "service stop" commands before that.
> 
> But then, if using a script like this, why not just type "halt"?
...

The real solution to the OP's problem has nothing to do with XFS, buffer
flushing, nor Linux shutdown modes.  The problem is power and automation
of cutting power.  And the solution is rather simple.

Put a small UPS in the van backing the server, connect USB or serial,
and configure upsmon.  When the crews hit the master switch, AC to the
UPS is lost, and upsmon then performs a clean shutdown of the server.
The crews do nothing more than they currently do.  And they don't have
to wait on anything.  If the previously described "master" switch *is*
currently a UPS, simply install another smaller unit inline to the
server.  Disable the audible alarm on the small unit as by default it
will screech continuously while AC input is absent.  At the end of the
day they simply flip the switch on this little UPS so it's not running
overnight/weekends (though with no load it probably wouldn't drain the
battery--this just a safety precaution).  At the start of the next day,
they flip the master switch, then the little UPS switch.

I've not laid eyes on the vans/power circuits/gear in question so I'm
making educated guesses.  There may be even better/easier ways to do it.
 But one way or another, a properly configured UPS/upsmon setup is the
way to go, if the desire is to easily control everything with power
switches.

-- 
Stan

<Prev in Thread] Current Thread [Next in Thread>