From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: Inconsistent consistency checkers Date: Tue, 30 Jun 2009 23:26:48 +0200 Message-ID: <20090630212648.GH3248@webber.adilger.int> References: <1212595845.633651246371270160.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> <778473364.633771246371379556.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT Cc: linux-fsdevel@vger.kernel.org To: Bob Peterson Return-path: Received: from sca-es-mail-1.Sun.COM ([192.18.43.132]:39340 "EHLO sca-es-mail-1.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039AbZF3V04 (ORCPT ); Tue, 30 Jun 2009 17:26:56 -0400 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n5ULQvrO010362 for ; Tue, 30 Jun 2009 14:26:57 -0700 (PDT) Content-disposition: inline Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) id <0KM200D00LZ94S00@fe-sfbay-10.sun.com> for linux-fsdevel@vger.kernel.org; Tue, 30 Jun 2009 14:26:57 -0700 (PDT) In-reply-to: <778473364.633771246371379556.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Jun 30, 2009 10:16 -0400, Bob Peterson wrote: > The rc.sysinit script used on many distros calls fsck specifying > the "-a" option for the root file system and file systems specified > to be checked in fstab. According to the fsck man page, -a is to > "Automatically repair the file system without any questions". This > -a parameter is passed on to the appropriate fsck.XXXX program. > The problem is, the various fsck programs are inconsistent in how > they interpret the -a parameter. Here's a sampling (in alphabetical > order): > > btrfsck - Rejects -a and -p (no ancillary command line args). > fsck.ext2 - Accepts -a but translates it into -p. Use of -a > is discouraged. The man page says "It is provided > for backwards compatibility only; it is suggested > that people use -p option whenever possible." I don't quite understand why Ted made "-a" discouraged, but "-p" does virtually the same thing. I guess the theory is that "-p" doesn't fix _everything_, and in some cases "-p" fails and requires manual intervention. > fsck.ext3 - Same as ext2 > fsck.ext4 - Same as ext3 > fsck.gfs2 - Rejects both -a and -p. > fsck.hfs - Rejects -a, but accepts -p. > fsck.jfs - Accepts -a and -p. > fsck.minix - Accepts -a but rejects -p. > fsck.ocfs2 - Rejects both -a and -p. > fsck.reiserfs - Accepts -a and -p. > fsck.vfat - Accepts -a but rejects -p. > fsck.xfs - Is completely a no-op with a good return code, the > theory being that its journal recovery should make > the fs sane. If you REALLY want to check or repair > your xfs file system, you need to run xfs_check or > xfs_repair. IMHO any fsck.* should at least do a minimal check of the filesystem, as fsck.ext* does without "-f" (superblock, basic filesystem structures, an on-disk error flag, in a second or two) so that the filesystem isn't auto-mounted on reboot with serious corruption and possibly causing worse corruption. This is doubly true with any filesystem that has the equivalent of "errors=panic" functionality, because it will otherwise cause a cycle of mount-error-panic-reboot-mount-... until someone arrives in the morning to find out what is broken. Also, without either an on-boot check, or online repair (btrfsck?) it isn't easy to check root filesystems, and lots of systems only configure a single root filesystem these days. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.