Re: fsck and format the filesystem at startup in case of error
From: Abdullah Ramazanoglu (ar018.REMOVE_at_CAPS.yahoo.cöm)
Date: 07/05/04
- Next message: Lew Pitcher: "Re: important question"
- Previous message: Abdullah Ramazanoglu: "Re: How to monitor i386 serial-port pins?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 05 Jul 2004 21:06:07 +0300
herc wrote:
> Hi,
>
> I want to change the fsck at startup for a particular partition
> (eg /dev/hdd3) in such a way that the fsck can't fix the error
> automatically it will not stop but format this partion again using
> mkfs.ext2 and send a messages to syslog.
> Can somebody tell me which startup script I have to change and how
> I can to this ? I using debian version 3.0. In the directory
> /etc/init.d I found a script checkfs.sh, since /dev/hdd3 is the
> only partion that will be mount as read-write ( the other
> partitions are mounted as ro) I suppose I need to change this
> script.
>
> Regards,
> herc
But checkfs.sh works for all partitions. So you must modify it in a
way it treats /dev/hdd3 specially (hardcoded).
I would prefer a different approach that doesn't interfere with
system startup scripts:
/etc/fstab ::
# auto-fsck and mount on boot disabled
/dev/hdd3 /mnt/hddthree ext3 noauto 0 0
/etc/rc2.d/S99zz.local -> /etc/init.d/zz.local ::
(Or, depending on your distro, /etc/rc.d/rc.local)
e2fsck -py /dev/hdd3
RC=$?
[ $RC = 2 ] && reboot
[ $RC > 3 ] && {
echo "hdd3 went south.." | tee -a /var/log/syslog
mke2fs -j -m1 /dev/hdd3 || echo "Antarctica."
}
mount /mnt/hddthree
Or something along that line. But, since /dev/hdd3 is mounted only
after the whole system is up and running, this setup won't work if
you must start some services that depend on /dev/hdd3 before you
reach the end of startup (zz.local).
P.S. Important to double check e2fsck return code meanings in your
version.
-- Abdullah | aramazan@ | Ramazanoglu | myrealbox | ________________| D O T cöm |
- Next message: Lew Pitcher: "Re: important question"
- Previous message: Abdullah Ramazanoglu: "Re: How to monitor i386 serial-port pins?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|