Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 1 Nov 2002 08:35:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 1 Nov 2002 08:35:36 -0500 Received: from mailgw.cvut.cz ([147.32.3.235]:27786 "EHLO mailgw.cvut.cz") by vger.kernel.org with ESMTP id ; Fri, 1 Nov 2002 08:35:34 -0500 From: "Petr Vandrovec" Organization: CC CTU Prague To: "Theodore Ts'o" Date: Fri, 1 Nov 2002 14:41:28 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: [Ext2-devel] Re: Htree ate my hard drive, was: post-hal Cc: Duncan Sands , Linux Kernel , ext2-devel@lists.sourceforge.net, adilger@clusterfs.com X-mailer: Pegasus Mail v3.50 Message-ID: <6457F663908@vcnet.vc.cvut.cz> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2193 Lines: 55 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/