gpart(8) not honoring sector sizes correctly?

Marcel Moolenaar xcllnt at mac.com
Sun Sep 13 22:59:44 UTC 2009


On Sep 13, 2009, at 11:31 AM, Geoff Fritz wrote:

> I just recently started using gpart, and I ran into what I think might
> be a bug.  I'm using FreeBSD/amd64 8.0-BETA4
>
> I have a geli provider with a 4096 sector size.  When I issued a
> "gpart add -s 1g -t freebsd_ufs ad0.eli" on this device, it appears
> the command assumes a 512-byte sector size, resulting in a partition
> that is 8G in size.  The bsdlabel command handles this correctly, so I
> assumed that gpart should.
>
> Is this a bug?

It's a known limitation. The sector size is not known when
parsing the arguments, so it's assumed to be standard. Just
specify the size in sectors when the sector size is known
not to be 512-bytes.

> I only began messing with gpart after reading that it's related (I
> think) to getting the new bsdlabel in FreeBSD 8.0 to utilize 26
> partitions (instead of the normal 8).  Is there any documentation on
> how to do this?

Create the BSD disklabel as follows:

	gpart create -s bsd -n 26 <disk>

FYI,

-- 
Marcel Moolenaar
xcllnt at mac.com





More information about the freebsd-geom mailing list