"gpart add" falsely claiming "No space left on device"
perryh at pluto.rain.com
Fri Sep 9 09:14:53 UTC 2016
"Brandon J. Wandersee" <brandon.wandersee at gmail.com> wrote:
> Perry Hutchison writes:
> > Warren Block <wblock at wonkity.com> wrote:
> >> What does the man page need?
> > For starters, default values for -b, -s, -t, and -i in "gpart add".
> > (I guess -i defaults to "lowest not currently in use", but what about
> > the others?)
> The defaults are exactly what you'd expect them to be. '-b' defaults
> to the start of the disk.
That would explain why my first attempt failed, since that default
is useful only if no partitions are already defined.
Other reasonable defaults would be the start of the first (lowest
addressed), last (highest addressed), or largest free area. In any
event, the man page ought to say what the default is.
> '-i' defaults to the lowest available integer.
as I suspected
> '-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!
> '-t' default to nothing,
> because it would be senseless to assume the type of a partition;
> gpart(8) will exit with an error if you don't provide it.
... which _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.
> > List of what-all "attributes" can be set and what they do.
> See "ATTRIBUTES."
There's no such section in the gpart(8) man page I'm looking at (on
> > Explanation of when one would use -b vs. -p in "gpart bootcode"
> > since they are apparently different ways of specifying where the
> > bootcode comes from (but then your example uses both?)
> '-b' and '-p' specify different values. '-b' specifies what is written;
> '-p' specifies how and where. How they're used depends on your partition
> scheme and motherboard. See "BOOTSTRAPPING."
There's no BOOTSTRAPPING section in this gpart(8) man page, either.
> > Description of how to show the current state of the provider vs what
> > it would look like if pending changes were committed.
> I don't know if this is possible. I believe it's assumed that the
> user/administrator has---or at least *should* have---a good idea
> of what state the disk is in before they start messing with the
> existing (presumably good) partition table.
Seems to me it kind of defeats the purpose of "pending" changes, if
I can't say "show me what would change if I committed this set" --
the same general idea as doing
:w !diff % -
in vi before saving the file.
> > I suppose there must be some reason for leaving those
> > 3.0k and 492k free spaces around gpboot, but it isn't obvious.
> Partition alignment.
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.
Getting back to the original inquiry, I'm still mystified as to
why gpart won't create a partition in the space that it reports
as being free. Does anyone have a clue what is going on, or how
to find out?
More information about the freebsd-questions