From nobody@FreeBSD.org  Tue Mar  6 20:29:59 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B8C8F106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  6 Mar 2012 20:29:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id A8BB48FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  6 Mar 2012 20:29:59 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q26KTxdj024388
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 6 Mar 2012 20:29:59 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q26KTxPb024387;
	Tue, 6 Mar 2012 20:29:59 GMT
	(envelope-from nobody)
Message-Id: <201203062029.q26KTxPb024387@red.freebsd.org>
Date: Tue, 6 Mar 2012 20:29:59 GMT
From: Jin Guojun <jguojun@sbcglobal.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsdlabel: partition c doesn't cover the whole unit!
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165789
>Category:       bin
>Synopsis:       bsdlabel(8): partition c doesn't cover the whole unit!
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-geom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 06 20:30:10 UTC 2012
>Closed-Date:    Wed Apr 18 05:18:04 UTC 2012
>Last-Modified:  Wed Apr 18 05:20:05 UTC 2012
>Originator:     Jin Guojun
>Release:        8.3-Beta
>Organization:
>Environment:
FreeBSD bsd 8.3-BETA1 FreeBSD 8.3-BETA1 #0: Wed Feb 29 12:44:48 PST 2012 
>Description:
% bsdlabel da0s2
# /dev/da0s2:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  c:  122334975          0    unused        0     0     # "raw" part, don't edit
  d:  122334975          0    4.2BSD        0     0     0
bsdlabel: partition c doesn't cover the whole unit!
bsdlabel: An incorrect partition c may cause problems for standard system utilities

% bsdlabel da0s1
# /dev/da0s1:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  c:   62910477          0    unused        0     0     # "raw" part, don't edit
  d:    2097152          0    4.2BSD        0     0     0
bsdlabel: partition c doesn't cover the whole unit!
bsdlabel: An incorrect partition c may cause problems for standard system utilities

bsdlabel sends out some non-sense message when showing a slice information.
For a disk drive with single slice, this may make sense. If a drive has multiple slices, the C cannot cover the entire disk space, and this message make no sense at all.

>How-To-Repeat:
Create a two or more slices on a hard disk drive then run bsdlabel on each slice.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-sysinstall 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Mar 12 07:25:17 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165789 
Responsible-Changed-From-To: freebsd-sysinstall->freebsd-geom 
Responsible-Changed-By: nwhitehorn 
Responsible-Changed-When: Mon Mar 12 15:59:39 UTC 2012 
Responsible-Changed-Why:  
Reassign to GEOM group, since this is (probably) some problem with gpart. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165789 
State-Changed-From-To: open->feedback 
State-Changed-By: ae 
State-Changed-When: Tue Mar 13 04:45:45 UTC 2012 
State-Changed-Why:  
Please, provide full list of commands to reproduce your problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165789 

From: Bengt Ahlgren <bengta@sics.se>
To: bug-followup@freebsd.org,
 jguojun@sbcglobal.net
Cc: ae@freebsd.org
Subject: Re: bin/165789: bsdlabel(8): partition c doesn't cover the whole unit!
Date: Fri, 6 Apr 2012 00:05:39 +0200

 I got the same message on my system newly upgraded to 8.3-RC1
 (r232744).  I have not touched the partitions since installing some
 time ago.  I definitely did not get this message from bsdlabel before.
 It also was bsdlabel that created the partitions, but I don't remember
 from which OS version.
 
 I want to point out that the "c" partition does indeed cover the whole
 slice.  See here:
 
 # gpart show ada1
 =>        63  1953525105  ada1  MBR  (931G)
           63    62926542     1  freebsd  [active]  (30G)
     62926605    62926605     2  freebsd  (30G)
    125853210  1827671958     3  freebsd  (871G)
 
 # gpart show ada1s1
 =>       0  62926542  ada1s1  BSD  (30G)
          0        16          - free -  (8.0k)
         16   2097152       1  freebsd-ufs  (1.0G)
    2097168   8388608       2  freebsd-swap  (4.0G)
   10485776   4194304       4  freebsd-ufs  (2.0G)
   14680080  48246462       5  freebsd-ufs  (23G)
 
 # bsdlabel ada1s1
 # /dev/ada1s1:
 8 partitions:
 #          size     offset    fstype   [fsize bsize bps/cpg]
   a:    2097152         16    4.2BSD        0     0     0
   b:    8388608    2097168      swap                    
   c:   62926542          0    unused        0     0     # "raw" part, don't edit
   d:    4194304   10485776    4.2BSD        0     0     0
   e:   48246462   14680080    4.2BSD        0     0     0
 bsdlabel: partition c doesn't cover the whole unit!
 bsdlabel: An incorrect partition c may cause problems for standard system utilities
 
 I added a printout of the value bsdlabel compares with:
 
 bsdlabel: partition c doesn't cover the whole unit! 1953525168
 
 This number corresponds to the size of the whole disk, not the size of
 the slice, so lp->d_secperunit is not the right variable to use, or is
 incorrectly set.
 
 Finally, I stepped back to r220455 (in stable/8).  That version of
 bsdlabel did not complain, so it seems that r227564 by ae (cc:d) is
 causing, or making visible, this problem.
 
 Bengt
State-Changed-From-To: feedback->closed 
State-Changed-By: ae 
State-Changed-When: Wed Apr 18 05:17:27 UTC 2012 
State-Changed-Why:  
Fixed in head/, stable/9 and stable/8. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=165789 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/165789: commit references a PR
Date: Wed, 18 Apr 2012 05:16:12 +0000 (UTC)

 Author: ae
 Date: Wed Apr 18 05:16:02 2012
 New Revision: 234410
 URL: http://svn.freebsd.org/changeset/base/234410
 
 Log:
   MFC r234122:
     It seems that libdisk(3) incorrectly sets d_secperunit value.
     Automatically fix it like GEOM_PART_BSD does.
   
     PR:		bin/165789
 
 Modified:
   stable/9/sbin/bsdlabel/bsdlabel.c
 Directory Properties:
   stable/9/sbin/bsdlabel/   (props changed)
 
 Modified: stable/9/sbin/bsdlabel/bsdlabel.c
 ==============================================================================
 --- stable/9/sbin/bsdlabel/bsdlabel.c	Wed Apr 18 05:12:17 2012	(r234409)
 +++ stable/9/sbin/bsdlabel/bsdlabel.c	Wed Apr 18 05:16:02 2012	(r234410)
 @@ -1194,7 +1194,8 @@ checklabel(struct disklabel *lp)
  			lp->d_interleave = vl->d_interleave;
  		if (lp->d_secpercyl == 0)
  			lp->d_secpercyl = vl->d_secpercyl;
 -		if (lp->d_secperunit == 0)
 +		if (lp->d_secperunit == 0 ||
 +		    lp->d_secperunit > vl->d_secperunit)
  			lp->d_secperunit = vl->d_secperunit;
  		if (lp->d_bbsize == 0)
  			lp->d_bbsize = vl->d_bbsize;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/165789: commit references a PR
Date: Wed, 18 Apr 2012 05:16:28 +0000 (UTC)

 Author: ae
 Date: Wed Apr 18 05:16:20 2012
 New Revision: 234411
 URL: http://svn.freebsd.org/changeset/base/234411
 
 Log:
   MFC r234122:
     It seems that libdisk(3) incorrectly sets d_secperunit value.
     Automatically fix it like GEOM_PART_BSD does.
   
     PR:		bin/165789
 
 Modified:
   stable/8/sbin/bsdlabel/bsdlabel.c
 Directory Properties:
   stable/8/sbin/bsdlabel/   (props changed)
 
 Modified: stable/8/sbin/bsdlabel/bsdlabel.c
 ==============================================================================
 --- stable/8/sbin/bsdlabel/bsdlabel.c	Wed Apr 18 05:16:02 2012	(r234410)
 +++ stable/8/sbin/bsdlabel/bsdlabel.c	Wed Apr 18 05:16:20 2012	(r234411)
 @@ -1187,7 +1187,8 @@ checklabel(struct disklabel *lp)
  			lp->d_interleave = vl->d_interleave;
  		if (lp->d_secpercyl == 0)
  			lp->d_secpercyl = vl->d_secpercyl;
 -		if (lp->d_secperunit == 0)
 +		if (lp->d_secperunit == 0 ||
 +		    lp->d_secperunit > vl->d_secperunit)
  			lp->d_secperunit = vl->d_secperunit;
  		if (lp->d_bbsize == 0)
  			lp->d_bbsize = vl->d_bbsize;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
