lkml.org 
[lkml]   [2002]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [Ext2-devel] Re: Htree ate my hard drive, was: post-hal
On 31 Oct 02 at 17:03, Theodore Ts'o wrote:
> On Thu, Oct 31, 2002 at 01:19:23PM +0200, Petr Vandrovec wrote:
> >
> > Nobody answered it at that time, and it happened at least 5 times
> > again to me - until I modified initscripts to do unconditional
> > reboot if "fsck /" did ANY modifications to filesystem.
> >
>
> In fact, e2fsck should return an exit code which indicates that the
> systme should be rebooted if an fsck the root filesystem makes any
> changes to the filesystem. See the man page to fsck(8) for a
> definition of fsck's exit codes, but if (exit_status & 2) is non-zero,
> the init scripts **should** reboot.

There is something wrong then...

> Unfortunately, not all distributions get this right. However, your
> analysis is right. If fsck needs to make any modifications to the
> root filesystem, which is mounted read-only, it is possible for the
> corrupted filesystem elements to still be cached in memory, and then
> written back out to disk when the filesystem is remounted read/write.

Debian does:

force=""
fix="-a"
spinner="-C"
fsck $spinner $force $fix /
if [ $? -gt 1 ]
then
echo "fsck failed..."
...
/sbin/sulogin
reboot -f
fi

which would catch return value '2' or any combination of 2 with anything
else. But fsck returns 1 - File system errors corrected. I just added
check for $? -eq 1, doing immediate reboot in such case in
/etc/init.d/checkroot.sh.

But I must admit that I did not checked whether 'system should be rebooted'
bit was not generated by e2fsck, or whether it was dropped by fsck wrapper,
or whether there is some addon patch in Debian fsck package.

System is debian unstable, currently using (e2)fsck 1.30-WIP, 30-Sep-2002.
Best regards,
Petr Vandrovec
vandrove@vc.cvut.cz

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.020 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site