From owner-freebsd-current@FreeBSD.ORG Fri Oct 7 19:03:55 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 35E5E1065670 for ; Fri, 7 Oct 2011 19:03:55 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id E9A5E8FC17 for ; Fri, 7 Oct 2011 19:03:54 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 937C25DA8; Fri, 7 Oct 2011 19:03:53 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.5/8.14.5) with ESMTP id p97J3qct081392; Fri, 7 Oct 2011 19:03:52 GMT (envelope-from phk@phk.freebsd.dk) To: Warren Block From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 07 Oct 2011 12:53:22 CST." Content-Type: text/plain; charset=ISO-8859-1 Date: Fri, 07 Oct 2011 19:03:52 +0000 Message-ID: <81391.1318014232@critter.freebsd.dk> Cc: 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:03:55 -0000 In message , Warren Block write s: >>>> Which is the exactly right question to ask. >>>> >>>> The procedure documented is clearly flawed. >>> > >Well, yes. The goal is to unprotect the device, regardless of what may >already be on it. Then the user can overwrite it with the memory stick >image. Unprotect from what ? from 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: (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... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.