From owner-freebsd-questions@freebsd.org Sun Oct 2 09:13:41 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DD3EAC69DA for ; Sun, 2 Oct 2016 09:13:41 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19A71DF8 for ; Sun, 2 Oct 2016 09:13:41 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id u929DacI089909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 2 Oct 2016 02:13:36 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id u929DZBk089908; Sun, 2 Oct 2016 02:13:35 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA18150; Sun, 2 Oct 16 01:45:07 PDT Date: Sun, 02 Oct 2016 01:44:59 -0700 From: perryh@pluto.rain.com (Perry Hutchison) To: wblock@wonkity.com, smithi@nimnet.asn.au Cc: dpchrist@holgerdanske.com, freebsd-questions@freebsd.org Subject: Re: FreeBSD-10.3-RELEASE-i386-memstick.img installer changes contents of USB flash drive Message-Id: <57f0c90b.o0Ro+n5Fmlq48GpP%perryh@pluto.rain.com> References: <20160929014801.W6806@sola.nimnet.asn.au> <20161001235138.N6806@sola.nimnet.asn.au> In-Reply-To: User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2016 09:13:41 -0000 Warren Block wrote: > On Sun, 2 Oct 2016, Ian Smith wrote: > > And then Perry Hutchinson (cc'd) is having the 'opposite' problem of > > wanting to update the 10.3 i386 memstick he'd booted off with gpart > > recover and gpart add for another partition, apparently successfully > > according to gpart show, only to have the updates disappear on reboot? > > Pretty sure that's an unrelated problem I've seen myself: > http://www.wonkity.com/~wblock/docs/html/labels.html > > If you change partition labels (or something) and then mount them, that > information is lost. If you reboot first, something works right. What I'm seeing does not fit that pattern. The sequence is: 1. dd the memstick image file to a 4GB flash drive. 2. Boot memstick in single-user mode, which mounts the root partition read-only and complains about a missing secondary GPT. 3. # gpart recover da0 4. Reboot, again in single-user mode, which mounts the root partition read-only. No GPT complaints this time. 5. # gpart show da0 This shows 3 partitions and 3.1 GB of free space. 6. # gpart add -t freebsd-ufs da0 7. # gpart show da0 This shows 4 partitions and no free space, as expected. 8. Reboot, again in single-user mode, which mounts the root partition read-only. No GPT complaints. 9. # gpart show da0 This shows 3 partitions and 3.1 GB of free space. WTF????? Note that nothing got mounted between steps 6 and 8. I can do 'gpart modify -l' to add labels to the 3 original partitions before or after step 6, and those labels survive the step 8 reboot although the result of 'gpart add' does not. I tried setting kern.geom.debugflags to 16 (the foot-shooting flag) before the 'gpart add' and it made no difference. And no, it is not a case of an orderly shutdown having written out an old in-memory instance of the GPT: I went so far as to yank the stick out of the USB port after step 7, and then power-cycle the machine, and the new partition *still* was gone after the reboot.