misc/146277: gpart add -s 128M creates 1GB partition on 4k sectorsize disk

Jeremy Faulkner gldisater at gmail.com
Tue May 4 00:30:01 UTC 2010


>Number:         146277
>Category:       misc
>Synopsis:       gpart add -s 128M creates 1GB partition on 4k sectorsize disk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 04 00:30:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Faulkner
>Release:        9-current
>Organization:
>Environment:
FreeBSD planet 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sun May 2 20:31:09 EDT 2010 gldisater at planet:/usr/obj/usr/src/sys/GENERIC i386
>Description:
When using gpart to create a GPT partition on a device that has a sector size of 4k it will create a partition that is much larger than requested. It appears to be using 512 sector size to calculate the number of sectors to allocate even when the sector size is not 512.
>How-To-Repeat:
gnop create -S 4k <disk or partition>
gpart create -s GPT <gnop'd disk or partition>
gpart add -s 512M -t freebsd-swap <gnop'd disk or partition>

gpart will create a 4GB partition instead of a 512M partition
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list