From owner-freebsd-current@FreeBSD.ORG Fri Oct 7 20:27:07 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 1BBB7106566B; Fri, 7 Oct 2011 20:27:07 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id B1EE68FC12; Fri, 7 Oct 2011 20:27:06 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id p97KR5kB003326; Fri, 7 Oct 2011 14:27:05 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id p97KR5qs003323; Fri, 7 Oct 2011 14:27:05 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Fri, 7 Oct 2011 14:27:05 -0600 (MDT) From: Warren Block To: Glen Barber In-Reply-To: <4E8F55CC.3060302@FreeBSD.org> Message-ID: References: <81477.1318015137@critter.freebsd.dk> <4E8F55CC.3060302@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Fri, 07 Oct 2011 14:27:06 -0600 (MDT) Cc: Garrett Cooper , Poul-Henning Kamp , 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 20:27:07 -0000 On Fri, 7 Oct 2011, Glen Barber wrote: > Hi, > > On 10/7/11 3:18 PM, Poul-Henning Kamp wrote: >>> 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. >> >> If none of the GPT partitions are open, you should be able to >> open /dev/da0. If not, the GPT geom class is buggy. >> > > In my experience, without kern.geom.debugflags=16, the MBR will not be > written to the memstick, leaving you with what would effectively be a > coaster in the not-so-distant past. Tried it just now with the 9.0-BETA3 memstick image. # dd if=/tmp/FreeBSD-9.0-BETA3-amd64-memstick.img of=/dev/da0 bs=64k 10463+1 records in 10463+1 records out 685731840 bytes transferred in 52.614157 secs (13033219 bytes/sec) # mount /dev/da0p2 /mnt # dd if=/tmp/FreeBSD-9.0-BETA3-amd64-memstick.img of=/dev/da0 bs=64k dd: /dev/da0: Operation not permitted # sysctl kern.geom.debugflags=16 kern.geom.debugflags: 0 -> 16 # dd if=/tmp/FreeBSD-9.0-BETA3-amd64-memstick.img of=/dev/da0 bs=64k 10463+1 records in 10463+1 records out 685731840 bytes transferred in 52.915362 secs (12959031 bytes/sec) Followed by removing the memory stick without unmounting it to avoid overwriting part of the image. No obvious problems, but no, it's not polite. (I'm thinking "automounter" here.) We could make the normal procedure just the dd, followed by a note: If this gives an 'Operation not permitted' error, make sure that the target device is not in use or being automounted by some helpful utility program. And maybe If the error still appears and no other options are available, sysctl kern.geomflags.debug=16 will override the system safety and allow writes to the device.