From owner-freebsd-questions@freebsd.org Tue Sep 6 14:16:57 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 CFF6ABC6BDD for ; Tue, 6 Sep 2016 14:16:57 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A21349B3 for ; Tue, 6 Sep 2016 14:16:57 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id u86EGuif016998 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Sep 2016 08:16:56 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id u86EGuS8016995; Tue, 6 Sep 2016 08:16:56 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 6 Sep 2016 08:16:56 -0600 (MDT) From: Warren Block To: Perry Hutchison cc: freebsd-questions@freebsd.org Subject: Re: "gpart add" falsely claiming "No space left on device" In-Reply-To: <57ce6e64.EITkODjuwy6pZ4L+%perryh@pluto.rain.com> Message-ID: References: <57ce6e64.EITkODjuwy6pZ4L+%perryh@pluto.rain.com> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Tue, 06 Sep 2016 08:16:56 -0600 (MDT) 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: Tue, 06 Sep 2016 14:16:57 -0000 On Tue, 6 Sep 2016, Perry Hutchison wrote: > I copied the 10.3-RELEASE memstick.img to a 4GB flash drive, then used > "gpart recover" to resize the partition table to the media. After that > "gpart show" reports: > > # gpart show da2 > => 3 7811067 da2 GPT (3.7G) > 3 32 1 freebsd-boot (16K) > 35 1348832 2 freebsd-ufs (659M) > 1348867 2048 3 freebsd-swap (1.0M) > 1350915 6460155 - free - (3.1G) > > but "gpart add" refuses to add a second freebsd-ufs partition in that > supposedly-free space: > > # gpart add -t freebsd-ufs -l pkgs -f x da2 > gpart: index '4': No space left on device > > # gpart add -t freebsd-ufs -l pkgs -f x -b 1350915 -s 6460155 da2 > gpart: index '4': No space left on device The second one makes more sense, as the first '-f x' would/should have allocated that space (in an uncommitted operation). Don't know about the first one, unless you have tried it before. Why bother with '-f x'? Why not just do the operation immediately?