From owner-freebsd-geom@freebsd.org Sun Sep 18 01:40:58 2016 Return-Path: Delivered-To: freebsd-geom@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 34AEDBDD35D for ; Sun, 18 Sep 2016 01:40:58 +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 03F5A170 for ; Sun, 18 Sep 2016 01:40:57 +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 u8I1etoD036408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 17 Sep 2016 18:40:56 -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 u8I1etrc036407 for freebsd-geom@freebsd.org; Sat, 17 Sep 2016 18:40:55 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA10601; Sat, 17 Sep 16 18:37:20 PDT Date: Sat, 17 Sep 2016 18:37:19 -0700 From: perryh@pluto.rain.com (Perry Hutchison) To: freebsd-geom@freebsd.org Subject: new partition on 10.3 i386 memstick disappearing on reboot Message-Id: <57ddefcf.jk4kZ2Kp+EcHfcFr%perryh@pluto.rain.com> 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-geom@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2016 01:40:58 -0000 Trying here after not finding a solution on questions@ I dd'd FreeBSD-10.3-RELEASE-i386-memstick.img to a 4GB flash drive, and booted it into single-user mode where it appeared as da0. Then, to resize the GPT to the media: # gpart show da0 # gpart recover da0 # gpart show da0 which appeared to work: the second "gpart show" showed more free space than the first following the partitions. Subsequently: # gpart show da0 # showed 3 partitions and about 3GB of free space # gpart add -t freebsd-ufs da0 # reported "da0p4 added" (or similar) # gpart show da0 # showed 4 partitions including the new one, and # no free space # shutdown -r now after rebooting: # gpart show da0 # showed 3 partitions and about 3GB of free space, # the same as before the "gpart add" operation i.e. the new partition is no longer there. I tried several times, sometimes allowing the "gpart add" to do the operation immediately and other times specifying "-f x" followed by "gpart commit", and the new partition never survived a reboot. It is not a matter of the GPT somehow being silently read-only: I also created or modified labels on the 3 original partitions, sometimes before "gpart add" and sometimes between the add and the reboot. The label operations always survived the reboot, but the partition creation never did. There is pretty clearly a bug of some sort here: if partition creation is somehow forbidden in this situation I should be getting an error message rather than having the operation appear to succeed -- on one occasion I even (successfully) ran newfs on it -- only to see the new partition disappear at reboot. How do I create a partition, that will survive reboot, in the free space at the end of the i386 memstick? BTW I also discovered in the course of this that "gpart commit" with no pending operations misleadingly says "Operation not permitted" rather than "Nothing to commit" or "No pending operations".