Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Dec 2002 11:49:22 -0800
From:      Kirk McKusick <mckusick@beastie.mckusick.com>
To:        Ruslan Ermilov <ru@FreeBSD.org>
Cc:        Petr Holub <hopet@ics.muni.cz>, Matt Dillon <dillon@FreeBSD.org>, current@FreeBSD.org
Subject:   Re: UFS1 created by 5.0 is incompatible with 4.0's? 
Message-ID:  <200212061949.gB6JnM59093695@beastie.mckusick.com>
In-Reply-To: Your message of "Fri, 06 Dec 2002 18:06:03 %2B0200." <20021206160603.GB1058@sunbay.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
    Date: Fri, 6 Dec 2002 18:06:03 +0200
    From: Ruslan Ermilov <ru@FreeBSD.org>
    To: Petr Holub <hopet@ics.muni.cz>, Matt Dillon <dillon@FreeBSD.org>
    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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212061949.gB6JnM59093695>