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

Re: No fsck in battery mode



[Harry]
> > > > 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. :-)

...

[jqdkf]
> > > If you use ext2, you can try `tune2fs -c 0 -i 3m`

...

[Tony]
> > 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 )

[Luke]
> Please show the hdparm bit.  There is the problem of routine file
> accesses, flushing, etc., spinning up the drive immediately after it spins
> down.
> 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
disabled entirely.

Here you go:

: sanity3~$ cat /etc/init.d/optimize_hd 
: 
: #!/bin/sh
: 
: DRIVES="/dev/hda"
: PARTS="/dev/hda1 /dev/hda2 /dev/hda6"
: 
: case "$1" in
: start|restart|reload)
:   if /usr/bin/on_ac_power
:   then
:     FSCK_MOUNTS=10
:     FSCK_INTERVAL=1w
:   else
:     FSCK_MOUNTS=40
:     FSCK_INTERVAL=3m
:   fi
:   for DRIVE in $DRIVES
:   do
:     /sbin/hdparm -c1 -d1 -p4 $DRIVE
:   done
:   for PART in $PARTS
:   do
:     tune2fs -c $FSCK_MOUNTS -i $FSCK_INTERVAL $PART
:   done
:   ;;   
: *)
:   ;;
: esac
 



Reply to: