From owner-freebsd-current@FreeBSD.ORG Sat Apr 26 08:37:08 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 ABB6737B401 for ; Sat, 26 Apr 2003 08:37:08 -0700 (PDT) Received: from ldc.ro (ldc-gw.rdsnet.ro [213.157.163.8]) by mx1.FreeBSD.org (Postfix) with SMTP id 1C19643F75 for ; Sat, 26 Apr 2003 08:37:07 -0700 (PDT) (envelope-from razor@ldc.ro) Received: (qmail 79920 invoked by uid 666); 26 Apr 2003 15:37:04 -0000 Date: Sat, 26 Apr 2003 18:37:04 +0300 From: Alex Popa To: freebsd-current@freebsd.org Message-ID: <20030426153704.GA79458@ldc.ro> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: 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 15:37:09 -0000 After an installation of 5.0-RELEASE, I have cvsupped to -current and remade the /var filesystem with newfs. After that, I tried to mount the filesystem on the 4.8 system I also have installed. It mounted fine (read-only), which should not have happened. Of course, I got a panic the moment I tried "ls" in /mnt. Also, dumpfs from -stable got a segmentation fault when trying to view that filesystem. 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. I don't have enough experience in programming for FreeBSD, but I think sbread() from libufs could be used to recognize an old (UFS1) filesystem and then wipe the old magic before creating an UFS2 filesystem. If anyone is willing to help (give me some pointers or suggesions to what else I should pay attention to), I can try and create a patch. Alex PS: The problem does not appear with the -current dumpfs because libufs in -current seems to check for the UFS2 magic first. PPS: If anyone needs them, I still have the vmcore and debug kernel from a crash of -stable, plus several different backtraces, but since the filesystem is severely corrupted (and incorrectly marked as "clean"), I don't think they are relevant. ------------+------------------------------------------------------- Alex Popa, | "Computer science is no more about computers than razor@ldc.ro| astronomy is about telescopes" -- E. W. Dijkstra ------------+------------------------------------------------------