Re: No fsck in battery mode
> > > > is there a way to avoid the regular fsck run (every n mounts or after m
> > > > days) when the laptop is in battery mode?
> > > >
> > > > I think its quite a waste of battery power for the fsck run and
> > > > rescheduling for the next reboot (with powersupply available) would be very
> > > > nice. :-)
> > > If you use ext2, you can try `tune2fs -c 0 -i 3m`
> > I like the idea of changing the interval, but I don't (as
> > others have also said) like your idea of disabling it.
> > So this is what I just made for my laptop:
> > ( this file also has hdparm control in it to make the drive
> > sleep more when on batteries, but that is not to the point,
> > so I omitted those refs )
> Please show the hdparm bit. There is the problem of routine file
> accesses, flushing, etc., spinning up the drive immediately after it spins
> I would be interested in how you deal therewith.
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
Here you go:
: sanity3~$ cat /etc/init.d/optimize_hd
: PARTS="/dev/hda1 /dev/hda2 /dev/hda6"
: case "$1" in
: if /usr/bin/on_ac_power
: for DRIVE in $DRIVES
: /sbin/hdparm -c1 -d1 -p4 $DRIVE
: for PART in $PARTS
: tune2fs -c $FSCK_MOUNTS -i $FSCK_INTERVAL $PART