Skip to Content.
Sympa Menu

baslinux - Re: [BL] don't want e2fsck to run on every boot

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: baslinux AT lists.ibiblio.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] don't want e2fsck to run on every boot
  • Date: Fri, 28 Mar 2008 17:24:01 +1200

Message from Steven
===================
James wrote:
>
> > If you wish, you could also add a variable that counts
> > to 20/50/whatever and does an e2fsck.
>
> The variable method sound to me like a great way of
> handling it. Can you provide further instructions on
> how to do that?

First, you define a counter (eg /tmp/c) to hold
the count between boots:
------------
touch /tmp/c
------------

Then you increment it (in /etc/rc) every time
the system boots:
-------------------------------------
let c=`cat /tmp/c`+1 ; echo $c>/tmp/c
-------------------------------------

Then you check it to see if it matches your
specified number of boots (eg 20):
--------------
[ $c = 20 ] &&
--------------

If it does, you reset your counter:
---------------------------
[ $c = 20 ] && echo 0>/tmp/c
---------------------------

And execute e2fsck:
-----------------------------------------------
[ $c = 20 ] && echo 0>/tmp/c && e2fsck...etc...
-----------------------------------------------

If you wish, you can put the above all in one line:
let c=`cat /tmp/c`+1;echo $c>/tmp/c;[ $c = 20 ]&&echo
0>/tmp/c&&e2fsck...etc...

Just make sure you touch /tmp/c before you run
this for the very first time; otherwise you will
get "file not found".

Cheers,
Steven





Archive powered by MHonArc 2.6.24.

Top of Page