How to force fsck at each boot ? - Redhat

This is a discussion on How to force fsck at each boot ? - Redhat ; Hi, The question is in the subject. I have a server which has a UPS which doesn't talk with the OS. So each time there is a long power failure and the UPS is getting empty, the system simply crashes ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: How to force fsck at each boot ?

  1. How to force fsck at each boot ?

    Hi,

    The question is in the subject.

    I have a server which has a UPS which doesn't talk with the OS.
    So each time there is a long power failure and the UPS is
    getting empty, the system simply crashes ...

    I found that shutdown can have the -F option to force it, but
    as I doubt I will go through it, I need to alter the file
    which is read at real boot time in a similar way of
    "max mounted time reached, fsck forced".

    System : RH 7.3

    Thanks for your help.

    Khan


  2. Re: How to force fsck at each boot ?

    "Gael" wrote in message
    news:c7o663$1gad$1@biggoron.nerim.net...
    > Hi,
    >
    > The question is in the subject.
    >
    > I have a server which has a UPS which doesn't talk with the OS.
    > So each time there is a long power failure and the UPS is
    > getting empty, the system simply crashes ...
    >
    > I found that shutdown can have the -F option to force it, but
    > as I doubt I will go through it, I need to alter the file
    > which is read at real boot time in a similar way of
    > "max mounted time reached, fsck forced".
    >
    > System : RH 7.3


    In rc.sysinit there is a line that looks like "AUTOFSCK_DEF_CHECK=no". Just
    change the "no" to "yes" and the system will now do a fsck on every boot
    unless you override it at boot time.

    Jeff Lary.



  3. Re: How to force fsck at each boot ?

    On Mon, 10 May 2004 17:20:59 +0200, Gael wrote:

    > I found that shutdown can have the -F option to force it, but as I doubt I
    > will go through it, I need to alter the file which is read at real boot
    > time in a similar way of "max mounted time reached, fsck forced".


    man tune2fs

  4. Re: How to force fsck at each boot ?

    Gael wrote:
    > Hi,
    >
    > The question is in the subject.
    >
    > I have a server which has a UPS which doesn't talk with the OS.
    > So each time there is a long power failure and the UPS is
    > getting empty, the system simply crashes ...
    >

    That would make me want to get another UPS. Do finances permit?

    --
    .~. Jean-David Beyer Registered Linux User 85642.
    /V\ Registered Machine 241939.
    /( )\ Shrewsbury, New Jersey http://counter.li.org
    ^^-^^ 14:45:00 up 17 days, 15:28, 3 users, load average: 4.30, 4.30, 3.94


  5. Re: How to force fsck at each boot ?

    In article , Gael wrote:
    > Hi,
    >
    > The question is in the subject.


    Add

    touch /forcefsck

    to your rc.local

    (the RH initscripts check for /forcefsck and if they
    find it, run "fsck -f" - you can also add

    echo "-V -- -v" > /fsckoptions

    to your rc.local if you want to see information

    - the /forcefsck and /fsckoptions files will be
    deleted after the boot, so you have to create
    them again -

    Actually, in my rc.local, I have:

    let x=(`cat /forcefsck.count`+1)%10
    echo $x > /forcefsck.count
    if [ $x -eq 0 ]
    then
    touch /forcefsck
    echo "-V -- -v" > /fsckoptions
    fi

    where /forcefsck.count is my own file which just has a number in
    it. This forces an fsck every ten reboots.

  6. Re: How to force fsck at each boot ?

    Lee Miller wrote:
    > On Mon, 10 May 2004 17:20:59 +0200, Gael wrote:
    >
    >
    >>I found that shutdown can have the -F option to force it, but as I doubt I
    >>will go through it, I need to alter the file which is read at real boot
    >>time in a similar way of "max mounted time reached, fsck forced".

    >
    >
    > man tune2fs


    This is exactly what I've done, putting the c option to 1.
    It does work exactly like I wanted to.

    The problem was to find the tune2fs )

    G.


  7. Re: How to force fsck at each boot ?

    Jean-David Beyer wrote:
    >>
    >> I have a server which has a UPS which doesn't talk with the OS.
    >> So each time there is a long power failure and the UPS is
    >> getting empty, the system simply crashes ...
    >>

    > That would make me want to get another UPS. Do finances permit?

    Unfortunatly not ;( The UPS is inside the server, and I don't have
    the right to open it ! It is designed for a very specific environnemnt
    so openning it, and changing components is out of question ...


    I know that after a while the HDD will be corrupted ... I already
    inform the users ...

    G.



+ Reply to Thread