From owner-freebsd-stable@FreeBSD.ORG Fri Mar 2 09:45:51 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A82E16A400 for ; Fri, 2 Mar 2007 09:45:51 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1C01F13C48E for ; Fri, 2 Mar 2007 09:45:51 +0000 (UTC) (envelope-from sam@errno.com) Received: from [10.1.43.246] ([130.226.7.91]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id l229jmpJ059082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Mar 2007 01:45:50 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <45E7F246.1030805@errno.com> Date: Fri, 02 Mar 2007 01:45:42 -0800 From: Sam Leffler Organization: Errno Consulting User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: Steven Hartland References: <00cb01c75c5b$4205e390$b3db87d4@multiplay.co.uk> In-Reply-To: <00cb01c75c5b$4205e390$b3db87d4@multiplay.co.uk> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com 1356; Body=5 Fuz1=5 Fuz2=5 Cc: freebsd-hackers@freebsd.org, freebsd-stable@freebsd.org Subject: Re: sysinstall creates corrupt filesystems after repartitioning X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2007 09:45:51 -0000 Steven Hartland wrote: > I've been repartitioning some of our machines here and > found that using the following method sysinstall creates > corrupt filesystems. > > 1. Boot a machine using an nfs mounted /usr > 2. Run: sysctl kern.geom.debugflags=16 to enable writing > to the disk mbr > 3. run sysinstall, Customise -> Label > 4. Delete the /usr partition e.g. /dev/da0s1f > 5. Create two partitions from the space left as ufs with > mount points /usr and /data > 6. Write the changes. > > Now two strange things happen: > 1. /usr ends up mounted twice once from nfs and once > from the new ufs. This requires umount -f /dev/da0s1f to > correct but doesnt always work properly requiring a reboot > to restore system functionality. > 2. The FS on both partitions is totally corrupt even fsck > cant repair them, even after a reboot. > > So the question is why would sysinstall create two corrupt > FS's with this procedure? > > Fixing is trivial just rerun the newfs commands and all > is good but its really odd that they should be corrupt > in the first place and caught me out big time when I first > did this as I had restored a full dump back onto /usr > and rebooted only for it to blow up horribly as the fs > was so badly corrupted. There's a debug flag you can turn on somewhere in the sysinstall menus. It may help diagnose what sysinstall is doing wrong by checking the log msgs. I find sysinstall is best diagnosed inside qemu or vmware so you destructively operate on disk images w/o hosing a real system. Sam