From owner-freebsd-questions@freebsd.org Fri Sep 9 14:46:08 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 3EE40BD2E41 for ; Fri, 9 Sep 2016 14:46:08 +0000 (UTC) (envelope-from brandon.wandersee@gmail.com) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13302D21 for ; Fri, 9 Sep 2016 14:46:07 +0000 (UTC) (envelope-from brandon.wandersee@gmail.com) Received: by mail-it0-f42.google.com with SMTP id i184so17443217itf.1 for ; Fri, 09 Sep 2016 07:46:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=WFM69Ys+qU3dL7h4LC+sy98P175YPyurtyvOduCQOVs=; b=HXbuCLx6I+6J8O1witGjIUHV1ddCrOUH0rUMoz5cMNXAgLQQdC1QmuwLhVEbpCJcSA pv6rz/WifuV1P4tIkf+/qrs8ZuChHSkq9/T1MSEF8P47kF0bkLkBz4r7fSd8BkJQGbPx W6aMt5z0nhodYCj8LDT8z1GBGPi6zNBdOQY1XhUeD9Vv5lIzDvtmrzLKPMkedvjVVIml hTZdw2hgbvfuw9iVxSSEcEMiB85QxDzIFx/FEMeIulyTh8CuqOC3nUEEhF7hBF69qXoz /gumbtXmcYzivNlqMKO5i65MUm3upSWB2k+QNFwYTBsiVaz5v3hS5f8GB0iPum/ywN4a rkzQ== X-Gm-Message-State: AE9vXwMx3qtM8rvAVywuVx7nMdyaJhN+B7Js9KsHfcjMszGlz6Gt4EKNN8UDu5me8KhUGg== X-Received: by 10.157.7.105 with SMTP id 96mr4588956ote.176.1473428818835; Fri, 09 Sep 2016 06:46:58 -0700 (PDT) Received: from WorkBox.Home.gmail.com (174-30-240-135.mpls.qwest.net. [174.30.240.135]) by smtp.gmail.com with ESMTPSA id f14sm1419277ita.10.2016.09.09.06.46.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Sep 2016 06:46:57 -0700 (PDT) References: <57ce6e64.EITkODjuwy6pZ4L+%perryh@pluto.rain.com> <57cf9b95.Zj/JGHeshaKL6Zr5%perryh@pluto.rain.com> <57d0f29b.3QNvCze7LJDzs0SU%perryh@pluto.rain.com> <86wpimm6om.fsf@WorkBox.Home> <57d276f6.CwaoGNki0kQYiZns%perryh@pluto.rain.com> <86r38tqjpw.fsf@WorkBox.Home> User-agent: mu4e 0.9.16; emacs 24.5.1 From: Brandon J. Wandersee To: "Brandon J. Wandersee" Cc: Perry Hutchison , wblock@wonkity.com, freebsd-questions@freebsd.org Subject: Re: "gpart add" falsely claiming "No space left on device" In-reply-to: <86r38tqjpw.fsf@WorkBox.Home> Date: Fri, 09 Sep 2016 08:47:00 -0500 Message-ID: <86poodqj6z.fsf@WorkBox.Home> MIME-Version: 1.0 Content-Type: text/plain 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: Fri, 09 Sep 2016 14:46:08 -0000 Brandon J. Wandersee writes: >> "Brandon J. Wandersee" wrote: >> >>> '-s' defaults to everything available. >> >> "available" on the entire disk (as if no partitions were defined), >> the first free block, or the largest free block? (One hopes, not >> the sum of all free blocks :) Again, the man page should say! > > "Available" as in "available based on logical context." If no > partitions are present on the disk, you get one partition starting at > the first sector and ending at the last, less any space needed for > scheme-specific metadata and buffer space resulting from '-a' or '-b.' > If partitions exist, you'll get a partition starting at the first free > sector and extending until you hit another partition or the end of the > disk, assuming the partition can be created in that space while > abiding by traits set with '-a' or '-b'. > > Obviously partitions can only consist of contiguous space, and the > command will not automatically destroy an existing partition > layout. `gpart add` *adds a partition.* Deleting and resizing > partitions, and destroying tables, are handled by separate commands. > >> [The need to specify partition type] _could_ be implied by its not >> being bracketed in the usage section, if not for the fact that -b and >> -s (which apparently do have defaults, even though the man page does >> not say what they are) are not bracketed either. > >> There's no [ATTRIBUTES] section in the gpart(8) man page I'm looking at (on >> FreeBSD 8.1) ... There's no BOOTSTRAPPING section in this gpart(8) >> man page, either. > > All of this---including the bracketed '-s' and '-b'---are present in > the latest version of the man page.[1] 8.1 hasn't been supported for four > years, so it's documentation won't be updated. I should add that you *can* install the up-to-date documentation manually, either from source (explained in the "Handbook") or with the misc/freebsd-doc-* port/package. Replace '*' with your native language. But since it looks like you're working on upgrading to 10.3, just use the online docs. >> Alignment to 4k makes sense if the physical sector size is 4k (as >> is often the case with newer disk drives) -- but 1M? Seems a bit >> much, which is why it would be useful for that page to include a >> more detailed explanation. > > Aligning to 1Mb guarantees that a partition is aligned to physical > sector boundaries regardless a disk's actual or reported sector > size. Newer HDD firmwares often report having 512k sectors for > backwards compatibility, even when they have 4k sectors, while SSDs > don't really have an industry-standard sector size and report whatever > the manufacturer feels like. But in all cases, they're factors of > 1Mb. The point is that you either spend some time and effort > researching each disk model in the system and doing some math, or you > just sacrifice a megabyte or two for guaranteed alignment and be done > with it. > > [1]: https://www.freebsd.org/cgi/man.cgi?query=gpart&apropos=0&sektion=8&manpath=FreeBSD+10.3-RELEASE+and+Ports&arch=default&format=html -- :: Brandon J. Wandersee :: brandon.wandersee@gmail.com :: -------------------------------------------------- :: 'The best design is as little design as possible.' :: --- Dieter Rams ----------------------------------