From owner-freebsd-stable@freebsd.org Mon Sep 26 01:12:10 2016 Return-Path: Delivered-To: freebsd-stable@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 656E7BEAFF2 for ; Mon, 26 Sep 2016 01:12:10 +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 47F8911F7 for ; Mon, 26 Sep 2016 01:12:10 +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 u8Q1C5mk029878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 25 Sep 2016 18:12:09 -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 u8Q1C53n029877 for freebsd-stable@freebsd.org; Sun, 25 Sep 2016 18:12:05 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA05088; Sun, 25 Sep 16 17:49:30 PDT Date: Sun, 25 Sep 2016 17:49:29 -0700 From: perryh@pluto.rain.com (Perry Hutchison) To: freebsd-stable@freebsd.org Subject: 10.3 gpart(8) strangeness Message-Id: <57e87099.y0HRwon108cNG6uj%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-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2016 01:12:10 -0000 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 (to make space for another partition): # gpart show da0 # gpart recover da0 # gpart show da0 which appeared to work: the second "gpart show" showed a larger free space following the partitions than the first, and that resizing survived a reboot. However, when I tried to create a 4th partition in that free space: # 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 -- as expected # shutdown -r now a "gpart show da0" after the reboot showed 3 partitions and about 3GB of free space, the same as before the "gpart add" operation. In other words, the new partition did not survive the reboot. I tried several variations, e.g. specifying "-f x" on the "gpart add" command (followed by a separate "gpart commit"), and I could never get the new partition to survive a reboot; but labels applied to the 3 pre-existing partitions using "gpart modify -l" did survive. Did I do something wrong, or have I stumbled over some obscure bug in the 10.3 gpart(8)? How do I create a partition, that will survive reboot, in the free space at the end of the i386 10.3 memstick?