NetBSD Problem Report #47314

From bughunting@xs4all.nl  Wed Dec 12 19:33:37 2012
Return-Path: <bughunting@xs4all.nl>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 7ED7763E33E
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 12 Dec 2012 19:33:37 +0000 (UTC)
Message-Id: <20121212193400.GA23166@frohike.homeunix.org>
Date: Wed, 12 Dec 2012 20:34:00 +0100
From: Bug Hunting <bughunting@xs4all.nl>
To: NetBSD GNATS <gnats-bugs@gnats.NetBSD.org>
Subject: Unclear / incorrect text in mbrlabel(8) man page [patch included]
X-Send-Pr-Version: 3.95

>Number:         47314
>Category:       bin
>Synopsis:       Unclear / incorrect text in mbrlabel(8) man page [patch included]
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 12 19:35:00 +0000 2012
>Closed-Date:    Wed Feb 27 20:41:49 +0000 2013
>Last-Modified:  Wed Feb 27 20:45:06 +0000 2013
>Originator:     Bug Hunting
>Release:        NetBSD 6.99.15
>Organization:

>Environment:

>Description:

The mbrlabel(8) man page contains an unclear and (partly) incorrect
paragraph about its working: mbrlabel(8) does not scan for extended
(in the MBR definition of it, i.e., one being able to hold logical
ones) MBR partitions only; also, as a disk can only contain _one_
MBR (master boot record), there's doubt about the wording ``MBRs
found in those extended partitions'' as well.



>How-To-Repeat:

Look up the corresponding man page's excerpt:

$ man 8 mbrlabel | sed -ne '14,17p'
     mbrlabel scans the MBR contained in the very first block of the disk (or
     the block specified through the -s flag), then walks through every
     extended partition found and generates additional partition entries for
     the disk from the MBRs found in those extended partitions.


Use the following example (which is just that: an example) to see
that not only extended partitions are taken into account: use
fdisk(8) on a disk currently holding only one MBR partition to
create a non-extended type MBR partition in partition slot 1 (i.e.,
a second MBR partition), and then see "mbrlabel" finding that
partition and adding it to the disk label -- even though it's not
an extended one (no example output provided here).


Additionally, look up the following comments on extended partition
handling in src/sbin/mbrlabel/mbrlabel.c (which is at r1.28, at
the moment):

$ grep -in '/\*.*extended' src/sbin/mbrlabel/mbrlabel.c
147:                            /* extended partitions are handled below */
226:                            /* recursively scan extended partitions */



>Fix:

Apply the proposed patch attached.  Note that the patch may or may
not need a bit more tweaking to be fully (technically) correct
regarding the program's exact workings; in particular, it doesn't
mention _where_ exactly the information for the to-be-created disk
label partitions is found, as the current mentioning of ``from the
MBRs found in those extended partitions'' isn't replaced by anything
else.

The top lines of the patch provide a proposed commit message, to
which a reference to this PR should be added though.

--rqzD5py0kzyFAOWN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mbrlabel.8_1.18.patch"

- Correct text and make it more clear;
- bump date.

From Bug Hunting.

---

Index: src/sbin/mbrlabel/mbrlabel.8
===================================================================
RCS file: /cvsroot/src/sbin/mbrlabel/mbrlabel.8,v
retrieving revision 1.18
diff -u -r1.18 mbrlabel.8
--- src/sbin/mbrlabel/mbrlabel.8	14 Jul 2012 20:13:30 -0000	1.18
+++ src/sbin/mbrlabel/mbrlabel.8	12 Dec 2012 19:13:34 -0000
@@ -29,7 +29,7 @@
 .\"
 .\"	$NetBSD: mbrlabel.8,v 1.18 2012/07/14 20:13:30 wiz Exp $
 .\"
-.Dd July 13, 2012
+.Dd December 12, 2012
 .Dt MBRLABEL 8
 .Os
 .Sh NAME
@@ -52,9 +52,9 @@
 scans the MBR contained in the very first block of the disk (or the
 block specified through the
 .Fl s
-flag), then walks through every extended partition found and generates
-additional partition entries for the disk from the MBRs found in
-those extended partitions.
+flag), walks through every partition (including extended ones) found,
+and generates additional partition entries for those partitions that
+are not already in the disk label.
 .Pp
 Each MBR partition which does not have an equivalent partition in the
 disk label (equivalent in having the same size and offset) is added to

--rqzD5py0kzyFAOWN--

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: is@NetBSD.org
State-Changed-When: Wed, 27 Feb 2013 20:41:49 +0000
State-Changed-Why:
Fixed differently. The official name for the sectors containing the
extended partitions is Extended Boot Records, so this name and the
abbreviation EBR is used in appropriate locations.


From: "Ignatios Souvatzis" <is@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47314 CVS commit: src/sbin/mbrlabel
Date: Wed, 27 Feb 2013 20:43:00 +0000

 Module Name:	src
 Committed By:	is
 Date:		Wed Feb 27 20:43:00 UTC 2013

 Modified Files:
 	src/sbin/mbrlabel: mbrlabel.8

 Log Message:
 Fix terminology issue brought up by Bug Hunting in PR 47314.
 The boot records in extended partitions are called "Extended Boot Record"
 (EBR); use that in the documentation where appropriate.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 src/sbin/mbrlabel/mbrlabel.8

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:
 --rqzD5py0kzyFAOWN
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.