[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: No fsck in battery mode

On Mon, Sep 08, 2003 at 11:47:27PM -0500, Tony Godshall wrote:
> Well, I mount the drives with noatime, which helps.  And I
> used to run noflushd.  But to be honest I haven't tested the
> spindown issue that much.  Mostly I use hdparm to get
> faster disk I/O.  By the way, I'm certainly no expert on
> these topics, but I pitched in my two bits when it came to the
> fsck issue, since I agree that it sucks to fsck on battery,
> but the full-fsck-every-few-mounts thing should not be
> disabled entirely.
> : start|restart|reload)
> :   if /usr/bin/on_ac_power
> :   then
> :     FSCK_MOUNTS=10
> :     FSCK_INTERVAL=1w
> :   else
> :     FSCK_MOUNTS=40
> :   for PART in $PARTS
> :   do
> :     tune2fs -c $FSCK_MOUNTS -i $FSCK_INTERVAL $PART

Ok, it's bothering me enough that I'm going to add my $0.02. Wasnt going to.

*Why* are you doing the tune2fs above? It doesnt do anything except change
the threshold for when a fsck will happen... ok, this may appear to help
when you're on battery power, but it's actually not helping as much as you
think. In all honesty, you should only have a difference of 5 or 10, as
you just want to raise the threshold enough to pass the time you dont have
power - which is likely to only be 5 or 6 mounts max, and perhaps a day or

Since 10/1w is far too often, even on a powered system, you'd be quite safe
to leave the settings at about 40/50, with 6m or so.

Instead of this approach, how about setting a longer period, and leaving it
there, doing what the manpage suggests - stagger the counts, so that you
only end up checking one fs each time one is needed.

an example:
/home gets lots of use, so say, 30 mounts.
/var is next, say 37 mounts
/usr next, maybe 43 mounts
/ last, perhaps 49 mounts.

Those are sufficiently staggered that you'll only get an overlap after
several hundred mounts.

Now, wouldnt that help save your battery more than mucking around with fs
settings that are much safer to leave alone?

(another option is to have your script touch /fastboot when on battery, as
that will completely bypass the running of fsck - just make sure it runs
before checkroot.sh!... you'd need a static copy of on_ac_power (well,
awk/grep..), and /etc/rcS.d/S09powercheck.sh or so)

Mike Beattie <mike@ethernal.org>                      ZL4TXK, IRLP Node 6184

    Never underestimate the power of very stupid people in large groups.

Reply to: