From owner-freebsd-questions@freebsd.org Fri Sep 9 13:49:44 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 BBB60BD2AB4 for ; Fri, 9 Sep 2016 13:49:44 +0000 (UTC) (envelope-from brandon.wandersee@gmail.com) Received: from mail-oi0-f67.google.com (mail-oi0-f67.google.com [209.85.218.67]) (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 8C7F47C8 for ; Fri, 9 Sep 2016 13:49:44 +0000 (UTC) (envelope-from brandon.wandersee@gmail.com) Received: by mail-oi0-f67.google.com with SMTP id y2so6067657oie.0 for ; Fri, 09 Sep 2016 06:49:44 -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=NLwgYFIx9MekRwGWPmiqB0IyCaZg8JEg47MM1xAbFxU=; b=aBlV0g5SI7u7SSPPlDiZ7T9HW+qXBuHuUo8ZbzSeyUWQlHXl7JNvecrzDnZQvZpevA KTDacYS8JNeViJzKXuyQWarUW5qTX0nDaE+vIGFSutcvwgHbKt7xqdVFcSON4UkJjJRL BY3KELZoY4QqkFRlZx4oTBHm/JXQuuKF5hGnqWzXwakCkEsytd65AHNQm99a0q8GXqh7 Wx7UREaH0jcsHKBFInG6ZW6GEEOR8F9S9P/h/eN7sMnuulwA9zNRT/y/V4y2Qv462P44 Sx+ayEXhcg73NUrjxlRiQJDBbxoGtLufw29C6Keov74pgYV9Ga3UiMB54Oyg0wkRQiPs VHfA== X-Gm-Message-State: AE9vXwNsVDxR9qJmEFirrSi9XNNtFphfiViBWswT9dyhP51x6tm+QBKau5uVzPfoDC3jGw== X-Received: by 10.157.1.167 with SMTP id e36mr5403419ote.114.1473428137137; Fri, 09 Sep 2016 06:35:37 -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 78sm251508ioi.31.2016.09.09.06.35.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Sep 2016 06:35:36 -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> User-agent: mu4e 0.9.16; emacs 24.5.1 From: Brandon J. Wandersee To: Perry Hutchison Cc: brandon.wandersee@gmail.com, wblock@wonkity.com, freebsd-questions@freebsd.org Subject: Re: "gpart add" falsely claiming "No space left on device" In-reply-to: <57d276f6.CwaoGNki0kQYiZns%perryh@pluto.rain.com> Date: Fri, 09 Sep 2016 08:35:39 -0500 Message-ID: <86r38tqjpw.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 13:49:44 -0000 > "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. > 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 ----------------------------------