From owner-freebsd-current@FreeBSD.ORG Fri Oct 7 19:15:30 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2B87106566B for ; Fri, 7 Oct 2011 19:15:30 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7351D8FC0C for ; Fri, 7 Oct 2011 19:15:30 +0000 (UTC) Received: by qadz30 with SMTP id z30so4035648qad.13 for ; Fri, 07 Oct 2011 12:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=bWDNje9ZUTLxXOhOb6z85TMFNwNShvLoIFwLxea1j84=; b=f9WG6tDSXC6fEHCZxQ1S7lir+RGfAL9V7mkHYUDHnsb8RTvUErBSb2cnhEucZHTqP/ t3032PnXJpwqDEzlTAxgLTeQr4YZoknABpnZxpEgQPrKO5gwznJ/ARaKHLzF5TSc6sWl Dpz24f6iQ1xbXs06OZptYikT52ZJ9d7B7LkNE= MIME-Version: 1.0 Received: by 10.224.181.11 with SMTP id bw11mr3049560qab.85.1318014929882; Fri, 07 Oct 2011 12:15:29 -0700 (PDT) Received: by 10.224.74.82 with HTTP; Fri, 7 Oct 2011 12:15:29 -0700 (PDT) In-Reply-To: <81391.1318014232@critter.freebsd.dk> References: <81391.1318014232@critter.freebsd.dk> Date: Fri, 7 Oct 2011 12:15:29 -0700 Message-ID: From: Garrett Cooper To: Poul-Henning Kamp Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Warren Block , freebsd-current@freebsd.org, Benjamin Kaduk , Arnaud Lacombe Subject: Re: aliasing (or renaming) kern.geom.debugflags X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 07 Oct 2011 19:15:30 -0000 On Fri, Oct 7, 2011 at 12:03 PM, Poul-Henning Kamp wro= te: > In message , Warren Block= write > s: > >>>>> Which is the exactly right question to ask. >>>>> >>>>> The procedure documented is clearly flawed. >>>> >> >>Well, yes. =A0The goal is to unprotect the device, regardless of what may >>already be on it. =A0Then the user can overwrite it with the memory stick >>image. > > Unprotect from what ? =A0from being already mounted ? > > If you cannot open a geom provider for writing, then it is because > some piece of code in the kernel thinks it already owns the device > and don't want you to muck about with it. > > Overriding this check is just asking for panics... > > > What I usually do in cases like this is: > > =A0 =A0 =A0 =A0(umount /dev/${whatever} || true) > /dev/null 2>&1 > > And if that isn't enough, or not possible, then the user needs > to undo whatever he did to the device... My guess is that GEOM isn't letting go of the GPT table and you have multiple partitions in the GPT table and you're not destroying them hierarchically in a proper manner.. but again, that's just a guess based on hazy recollection. -Garrett