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

Re: force e2fsck @ reboot



And thus spake Martin Schulze, on Mon, Aug 31, 1998 at 01:47:33AM +0200:
> I maintain several linux boxes, some of them doesn't have a kbd nor
> a monitor connected to them, some of them are difficult to reach.
> 
> In order to maintain the with a minimum of manual interaction it
> would be nice if they would check *and* repair their filesystems
> at boot time - always.
> 
> To achieve this one needs to modify /etc/init.d/checkfs.sh alightly.
> 
> Instead of 
> 
>     fsck -R -A $fix $force
> 
> one should call
> 
>     fsck -R -A -f -y -p

I don't think you'd want to use -f, but if you set FSCKFIX to yes in
/etc/default/rcS and change fix="-y" to fix="-yp" in checkfs.sh, it
should do what you want. -yp should probably be the default if FSCKFIX
is set to yes, I'd say, but that's up to the maintainer.

> Since /etc/default/rcS is sourced before this could be controlled
> by a variable like "FSCKFORCEREPAIR=y".

See FSCKFIX.

> What do others think?

I use FSCKFIX=yes without any checkfs.sh changes and haven't had the
systems freeze up waiting for input on any rebote reboots (yet).

> Now something different.  Tonight I had to reboot a machine where the
> filesystem was crashed and several processes including sync were in
> status 'D' (non-interruptible).  Thus a "reboot" didn't work and
> so I tried to omit init and force a reboot with "shutdown -r -n".
> 
> Unfortunately this didn't show the expected results.  All processes
> seemed to be killed (at least my two ssh's were killed, together
> with inetd and sshd), so I wasn't able to log in anymore.  But the
> kernel didn't reboot.  This is not funny since I had to ride to their
> location and press the reset button.
> 
> Is there an easy way to do this remote?

The only way to force a reboot is reboot -f.

Be very careful with it. It doesn't touch init in any way, nor does it
flush the filesystems or touch them in any way - it just reboots.

-- 
Elie Rosenblum <erosenbl at nyx.net>That is not dead which can eternal lie,
     <fnord at cosanostra.net>   And with strange aeons even death may die.
Developer / Mercenary / System Administrator             - _The Necromicon_


Reply to: