From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 25 19:22:09 2007 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BFE916A418 for ; Tue, 25 Sep 2007 19:22:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (adsl-75-1-14-242.dsl.scrm01.sbcglobal.net [75.1.14.242]) by mx1.freebsd.org (Postfix) with ESMTP id 6420E13C457 for ; Tue, 25 Sep 2007 19:22:09 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id l8PJM284010258; Tue, 25 Sep 2007 12:22:06 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200709251922.l8PJM284010258@gw.catspoiler.org> Date: Tue, 25 Sep 2007 12:22:02 -0700 (PDT) From: Don Lewis To: samflanker@gmail.com In-Reply-To: <46F8CC62.903@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: freebsd-hackers@FreeBSD.org Subject: Re: fsck of large volume with small memory X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 19:22:09 -0000 On 25 Sep, sam wrote: > sam wrote: >> Don Lewis wrote: >>> On 24 Sep, sam wrote: >>> Expect major file system lossage ... >>> I think this patch could be better, but this should get you going ... >>> >>> >> >> >> UNEXPECTED SOFT UPDATE INCONSISTENCY >> LOST 74 DIRECTORIES >> >> UNEXPECTED SOFT UPDATE INCONSISTENCY >> fsck: /dev/aacd0s1f: Segmentation fault: 11 It would be good to know the cause of this segfault so that the code could be fixed to prevent it. >> # >> ====================================================== >> >> /Vladimir Ermakov >> >> > # cat /etc/rc.conf |grep fsck > fsck_y_enable="YES" > background_fsck="NO" > > hm, and after system reboot > > ================================================= > # fsck /dev/aacd0s1f > ** /dev/aacd0s1f (NO WRITE) > ** Last Mounted on /usr > ** Phase 1 - Check Blocks and Sizes > ** Phase 2 - Check Pathnames > ** Phase 3 - Check Connectivity > ** Phase 4 - Check Reference Counts > ** Phase 5 - Check Cyl groups > 438959 files, 3567329 used, 69528964 free (94684 frags, 8679285 blocks, > 0.1% fragmentation) > # > ================================================= That's the fastest way of getting the file system back into a consistent state (or you could run "fsck -y" in single-user mode), but it increases the probability of data loss. The problem is that my patch allows fsck to examine a bunch of uninitialized inodes in the damaged cylinder group, and there is the possibility that one or more of these inodes could look reasonably valid and contain block pointers that point to blocks in valid files. Fsck will then detect the duplicate block pointers and clear the inodes for both files. It would be nice if fsck could be told to put less trust in the inodes that might not actually be initialized, but this gets complicated ...