Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 May 2012 21:47:43 GMT
From:      Warren Block <wblock@wonkity.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/167567: gpart(8) -a alignment silently overrides -b beginning option
Message-ID:  <201205032147.q43LlhWj050959@red.freebsd.org>
Resent-Message-ID: <201205032150.q43Lo5DA091184@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         167567
>Category:       bin
>Synopsis:       gpart(8) -a alignment silently overrides -b beginning option
>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:   Thu May 03 21:50:05 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Warren Block
>Release:        9-STABLE
>Organization:
>Environment:
FreeBSD lightning 9.0-STABLE FreeBSD 9.0-STABLE #0 r234953: Thu May  3 09:21:21 MDT 2012     root@lightning:/usr/obj/usr/src/sys/LIGHTNING  amd64
>Description:
When both the -a and -b options are given, -a overrides the value given by -b.

gpart add -t freebsd-ufs -a4k -b1m -s2g ada0

adds a partition that starts at the next available even multiple of 4k rather than at 1M.  If the -b value is an even multiple of the -a value, it should be used.  Otherwise, an error should be shown.
>How-To-Repeat:
gpart create -s gpt ada0
gpart add -t freebsd-boot -a4k -s512k ada0
gpart add -t freebsd-ufs -a4k -b1m -s2g ada0
gpart show ada0
=>      34  42680253  ada0  GPT  (20G)
        34         6        - free -  (3.0k)
        40      1024     1  freebsd-boot  (512k)
      1064   4194304     2  freebsd-ufs  (2.0G)
   4195368  38484919        - free -  (18G)

The freebsd-ufs partition should start at 2048, or 1M.
>Fix:
If a -b value is given, compare it to the alignment value.  Use if it matches the alignment, otherwise error out.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205032147.q43LlhWj050959>