From owner-freebsd-questions@FreeBSD.ORG Thu Aug 21 15:23:44 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF3B1065675 for ; Thu, 21 Aug 2008 15:23:44 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DADB58FC1B; Thu, 21 Aug 2008 15:23:42 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <48AD887D.3010209@FreeBSD.org> Date: Thu, 21 Aug 2008 17:23:41 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Polytropon References: <20080821171509.5974eda9.freebsd@edvax.de> In-Reply-To: <20080821171509.5974eda9.freebsd@edvax.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-questions@freebsd.org" Subject: Re: Again: fsck_ffs memory requirements X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 15:23:44 -0000 Polytropon wrote: > Hi again! > > I had problems running fsck_ffs of FreeBSD 5. In my particular > problem, version 5 seemed to help me more than version 7, which > stopped with this: > > fsck_ffs: bad inode number 306176 to nextinode > > Version 5 didn't seem to have this problem, but it did complain: > > fsck_ffs: cannot alloc 1073796864 bytes for inoinfo > > So I asked for help and was adviced to enable swap space before > running fsck_ffs in SUM. My main problem seemed to be that I hadn't > enough RAM (512 + 256 MB SRD-SDRAM), exactly 1 GB seemed to be > required. > > In the recovery setting, ad0 is a FreeBSD 5 installation and ad2 > is a FreeBSD 7 installation with a /home partition holding a dd > image of the defective partition (which's original is on a harddisk > on the shelf for security reasons). > > I did the following after successful system startup in SUM: > > # swapon /dev/ad2s1b > > # swapctl -l > Device: 1024-blocks Used: > /dev/ad2s1b 2097152 0 > > # mount /dev/ad2s1g /mnt > > # mdconfig -a -u 0 -t vnode -f /mnt/poly/rescue/ad1s1f.dd > > # fsck_ffs -yf /dev/md0 > ** /dev/md0 > ** Last Mounted on > ** Phase 1 - Check Blocks and Sizes > 1035979 BAD I=259127 > UNEXPECTED SOFT UPDATE INCONSISTENCY > > [...] > > 9187201950452580480 BAD I=262821 > UNEXPECTED SOFT UPDATE INCONSISTENCY > > 9114861777597661055 BAD I=262821 > UNEXPECTED SOFT UPDATE INCONSISTENCY > > EXCESSIVE BAD BLKS I=262821 > CONTINUE? yes > > 1779904 DUP I=262822 > UNEXPECTED SOFT UPDATE INCONSISTENCY > > 1779905 DUP I=262822 > UNEXPECTED SOFT UPDATE INCONSISTENCY > > [...] > > 4007775 DUP I=262845 > UNEXPECTED SOFT UPDATE INCONSISTENCY > > fsck_ffs: cannot alloc 1073796864 bytes for inoinfo > > # > > So I examined /usr/src/sbin/fsck_ffs/pass1.c and found out > that a calloc() call caused the error; 1 GB was needed, but > 2 GB were present in swap. Not enough? > > Any suggestions what I could do to help fsck_ffs calloc()ing > the needed memory? Increase kern.maxdsiz. The attempt to malloc this much may be wrong anyway though, if the filesystem is so badly corrupted that fsck is confused. Kris Kris