Date: Fri, 6 Dec 2002 18:06:03 +0200
    From: Ruslan Ermilov <[EMAIL PROTECTED]>
    To: Petr Holub <[EMAIL PROTECTED]>, Matt Dillon <[EMAIL PROTECTED]>
    Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
    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,
    [EMAIL PROTECTED]               Sunbay Software AG,
    [EMAIL PROTECTED]              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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to