From owner-freebsd-current Fri Dec 6 11:49:26 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2462F37B401; Fri, 6 Dec 2002 11:49:24 -0800 (PST) Received: from beastie.mckusick.com (beastie.mckusick.com [209.31.233.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4225D43EC5; Fri, 6 Dec 2002 11:49:23 -0800 (PST) (envelope-from mckusick@beastie.mckusick.com) Received: from beastie.mckusick.com (localhost [127.0.0.1]) by beastie.mckusick.com (8.12.3/8.12.3) with ESMTP id gB6JnM59093695; Fri, 6 Dec 2002 11:49:22 -0800 (PST) (envelope-from mckusick@beastie.mckusick.com) Message-Id: <200212061949.gB6JnM59093695@beastie.mckusick.com> To: Ruslan Ermilov Subject: Re: UFS1 created by 5.0 is incompatible with 4.0's? Cc: Petr Holub , Matt Dillon , current@FreeBSD.org In-Reply-To: Your message of "Fri, 06 Dec 2002 18:06:03 +0200." <20021206160603.GB1058@sunbay.com> Date: Fri, 06 Dec 2002 11:49:22 -0800 From: Kirk McKusick Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Date: Fri, 6 Dec 2002 18:06:03 +0200 From: Ruslan Ermilov To: Petr Holub , Matt Dillon Cc: current@FreeBSD.org, mckusick@beastie.mckusick.com Subject: Re: UFS1 created by 5.0 is incompatible with 4.0's? X-ASK-Info: Whitelist match On Fri, Dec 06, 2002 at 01:59:11PM +0100, Petr Holub wrote: > Hi, >=20 > > While testing the 4.0 -> 5.0 upgrade path, I've created (under > > 5.0) a UFS1 partition and installed 4.0 onto it. After booting > > the 4.0 from it, kernel complained about ``numdirs is zero, try > > using an alternate superblock'' for / partition -- I've tried > > what it suggests (by fsck -b 32, etc.) but the result was always > > the same -- the file system was marked dirty and only read-only > > usable. After rebooting in 5.0, this file system was similarly > > unusable. Is this a bug or a feature? >=20 > I've discussed this issue with Poul-Henning Kamp. You need fsck > from at least 4.7. >=20 Is this handled by fsck/setup.c,v 1.17.2.4 commit? : revision 1.17.2.4 : date: 2002/06/24 05:10:41; author: dillon; state: Exp; lines: +26 -56 : MFC 1.30. Check only the fields we know should be the same between the : primary and alternate superblocks, so fsck doesn't barf on new features : added to UFS in later releases. :=20 : Submitted by: mckusick Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age If the 1.17.2.4 commit does not solve your problem, try the following patch that I made to the 5.0 fsck. If it solves your problem, then it should probably be MFC'ed. Kirk McKusick Index: sbin/fsck_ffs/setup.c =================================================================== RCS file: /usr/ncvs/src/sbin/fsck_ffs/setup.c,v retrieving revision 1.41 diff -c -r1.41 setup.c *** setup.c 2002/11/27 02:18:57 1.41 --- setup.c 2002/12/04 23:13:18 *************** *** 258,269 **** (unsigned)(sizeof(struct inostatlist) * (sblock.fs_ncg))); goto badsb; } ! numdirs = sblock.fs_cstotal.cs_ndir; dirhash = numdirs; - if (numdirs == 0) { - printf("numdirs is zero, try using an alternate superblock\n"); - goto badsb; - } inplast = 0; listmax = numdirs + 10; inpsort = (struct inoinfo **)calloc((unsigned)listmax, --- 258,265 ---- (unsigned)(sizeof(struct inostatlist) * (sblock.fs_ncg))); goto badsb; } ! numdirs = MAX(sblock.fs_cstotal.cs_ndir, 128); dirhash = numdirs; inplast = 0; listmax = numdirs + 10; inpsort = (struct inoinfo **)calloc((unsigned)listmax, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message