Re: No fsck in battery mode
According to Mike Beattie,
> 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
Well, without any good data, I assumed that if the default of
40 was appropriate for normal use, and I wanted to force a
fsck on AC-powered use often enough that it would be unlikely
to hit the larger number happen when on battery.
> 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.
Doesn't actually bother me to do it that often when on A/C.
I play with bleeding edge kernels, so better safe than
sorry. I also backup via rsync to more stable boxes a lot.
> 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.
Well, I don't partition that way.
> 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?
Are they better left alone? Why?
> (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)
Thanks for bringing this up. I wasn't aware of /fastboot.
Looks like a good solution. Well, except that / has to be