bin/169542: gpart: partition alignment doesn't works on MBR

Sayetsky Anton vsjcfm at gmail.com
Fri Jun 29 13:30:14 UTC 2012


>Number:         169542
>Category:       bin
>Synopsis:       gpart: partition alignment doesn't works on MBR
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 29 13:30:13 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Sayetsky Anton
>Release:        FreeBSD 8.3-RELEASE-p1 amd64
>Organization:
>Environment:
System: FreeBSD jw.local 8.3-RELEASE-p1 FreeBSD 8.3-RELEASE-p1 #0 r235504: Wed May 16 14:33:18 EEST 2012 root at j.local:/tmp/obj/mnt/garbage/build/src/sys/JASONW amd64
>Description:
Alignment values computed by gpart are incorrect when using MBR scheme.
When using GPT - they are correct.
As wee can see below, alignment & size of partitions isn't divideable by 8 when using "-a 4k"
>How-To-Repeat:
********************* MBR **************************
root at jw:~# mdconfig -s 2048m
md0
root at jw:~# gpart create -s mbr md0
md0 created
root at jw:~# gpart show md0
=> 63 4194241 md0 MBR (2.0G)
63 4194241 - free - (2G)

root at jw:~# gpart add -a 4k -t freebsd -s 100m md0
md0s1 added
root at jw:~# gpart add -a 4k -t freebsd md0
md0s2 added
root at jw:~# gpart show md0
=> 63 4194241 md0 MBR (2.0G)
63 63 - free - (31k)
126 204687 1 freebsd (100M)
204813 63 - free - (31k)
204876 3989412 2 freebsd (1.9G)
4194288 16 - free - (8.0k)
********************* MBR **************************

********************* GPT **************************
root at jw:~# mdconfig -s 2048m
md0
root at jw:~# gpart create -s gpt md0
md0 created
root at jw:~# gpart add -a 4k -t freebsd -s 100m md0
md0s1 added
root at jw:~# gpart add -a 4k -t freebsd md0
md0s2 added
root at jw:~# gpart show md0
=>     34  4194237  md0  GPT  (2.0G)
      34        6       - free -  (3.0k)
      40   204800    1  freebsd  (100M)
  204840  3989424    2  freebsd  (1.9G)
 4194264        7       - free -  (3.5k)
********************* GPT **************************
>Fix:

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


More information about the freebsd-bugs mailing list