From owner-freebsd-current@FreeBSD.ORG Sat Apr 26 14:01:53 2003 Return-Path: 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 4B9A337B401 for ; Sat, 26 Apr 2003 14:01:53 -0700 (PDT) Received: from mailbox.univie.ac.at (mail.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1851A43FA3 for ; Sat, 26 Apr 2003 14:01:52 -0700 (PDT) (envelope-from l.ertl@univie.ac.at) Received: from localhost.localdomain (adslle.cc.univie.ac.at [131.130.102.11]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h3QL1fPD104990; Sat, 26 Apr 2003 23:01:45 +0200 Date: Sat, 26 Apr 2003 23:01:41 +0200 (CEST) From: Lukas Ertl To: freebsd-current@freebsd.org Message-ID: <20030426225533.R743@leelou.in.tern> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: unet 4261; Body=2 Fuz1=2 Fuz2=2 cc: razor@ldc.ro Subject: Re: newfs for UFS2 problems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2003 21:01:53 -0000 Alex Popa wrote: > It seems the problem is partly caused by newfs on -current, which does > not remove the old UFS1 magic when creating an UFS2 superblock at a > different location. This leftover magic is seen by the -stable kernel > and therefore used. Hi Alex, could you try this patch to newfs(8)? It wipes the old UFS1 superblock at location SBLOCK_UFS1 before writing the new superblock at location SBLOCK_UFS2. ---8<--- Index: sbin/newfs/mkfs.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /u/cvs/cvs/src/sbin/newfs/mkfs.c,v retrieving revision 1.74 diff -u -r1.74 mkfs.c --- sbin/newfs/mkfs.c=0922 Feb 2003 23:26:11 -0000=091.74 +++ sbin/newfs/mkfs.c=0926 Apr 2003 20:54:56 -0000 @@ -113,6 +113,7 @@ =09quad_t sizepb; =09int width; =09char tmpbuf[100];=09/* XXX this will break in about 2,500 years */ +=09char dummy[SBLOCKSIZE]; =09/* =09 * Our blocks =3D=3D sector size, and the version of UFS we are using i= s @@ -479,8 +480,13 @@ =09=09sblock.fs_old_cstotal.cs_nifree =3D sblock.fs_cstotal.cs_nifree; =09=09sblock.fs_old_cstotal.cs_nffree =3D sblock.fs_cstotal.cs_nffree; =09} -=09if (!Nflag) +=09if (!Nflag) { +=09=09if (Oflag !=3D 1) { +=09=09=09memset(dummy, '\0', SBLOCKSIZE); +=09=09=09bwrite(&disk, SBLOCK_UFS1, dummy, SBLOCKSIZE); +=09=09} =09=09sbwrite(&disk, 0); +=09} =09for (i =3D 0; i < sblock.fs_cssize; i +=3D sblock.fs_bsize) =09=09wtfs(fsbtodb(&sblock, sblock.fs_csaddr + numfrags(&sblock, i)), =09=09=09sblock.fs_cssize - i < sblock.fs_bsize ? ---8<--- best regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/