From owner-freebsd-stable@FreeBSD.ORG Thu Feb 18 04:41:20 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 570D6106566B for ; Thu, 18 Feb 2010 04:41:20 +0000 (UTC) (envelope-from lists@mawer.org) Received: from mail-pz0-f202.google.com (mail-pz0-f202.google.com [209.85.222.202]) by mx1.freebsd.org (Postfix) with ESMTP id 389DB8FC1F for ; Thu, 18 Feb 2010 04:41:19 +0000 (UTC) Received: by pzk40 with SMTP id 40so5424031pzk.7 for ; Wed, 17 Feb 2010 20:41:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.141.101.7 with SMTP id d7mr5700023rvm.78.1266466659541; Wed, 17 Feb 2010 20:17:39 -0800 (PST) In-Reply-To: <20100217192253.GA31689@icarus.home.lan> References: <20100217021136.GA10628@icarus.home.lan> <20100217192253.GA31689@icarus.home.lan> Date: Thu, 18 Feb 2010 15:17:39 +1100 Message-ID: From: Antony Mawer To: Jeremy Chadwick Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable@freebsd.org Subject: Re: netboot issues, 8.0, mfsroot mount failure 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: Thu, 18 Feb 2010 04:41:20 -0000 On Thu, Feb 18, 2010 at 6:22 AM, Jeremy Chadwick wrote: > On Tue, Feb 16, 2010 at 11:43:30PM -0500, Charles Sprickman wrote: >> >Footnote: This is why I tell folks to zero out the first 8192 bytes of >> >any disk they've previously installed FreeBSD on (even if the disk has >> >no filesystems/slices on it). =A0The way FreeBSD determines the size of >> >the disk differs in RELENG_8; I believe GEOM "figures it out" on its ow= n >> >now, while previous releases relied on the "c" slice. =A0The method I'v= e >> >recommended: do dd if=3D/dev/zero of=3D/dev/adX bs=3D512 count=3D16. >> >> Is it also advisable to blot out any old glabel stuff at the end of >> the disk? =A0What's the math to get that? =A0Get a sector count for the >> whole disk, set "bs" to 512 and "skip" to (sector count - 1)? > > I don't think the glabel data (which goes at the end of the disk) is > relevant to the above problem I described. =A0You can erase it if you > want, but I doubt it's responsible for warnings like "Disk geometry does > not match label!" or situations where a user is re-using a disk (that > had its slices created on RELENG_7) on RELENG_8 and experiences > problems. =A0An alternative to the dd method might be to try "gpart > destroy"; I haven't tried to see if relieves the problem. > > As far as how to erase the glabel metadata -- "glabel clear" is supposed > to do this for you. =A0What I don't know is whether or not addition of a > glabel decreases what GEOM thinks the total size of the disk is, so I > can't say for certain doing some math + zeroing the last sector of the > disk would actually work. I have recently been using the following snippet in an install script to zero out any existing gmirror/etc metadata before the install proceeds (and potentially reconfigures a new gmirror etc): # Specify the disk device to clear diskdev=3D"da0" # Clear metadata from the last sector on the drive echo "Clearing any GEOM metadata on drive..." diskinfo=3D`diskinfo /dev/$diskdev` sector_size=3D`echo $diskinfo | cut -f2 -d\ ` size_in_sectors=3D`echo $diskinfo | cut -f4 -d\ ` geom_offset=3D$(($size_in_sectors-1)) dd if=3D/dev/zero of=3D/dev/$diskdev bs=3D$sector_size oseek=3D$geom_offset count=3D1 2> /dev/null In preliminary testing it seems to do the job... -- Antony