NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/47314: Unclear / incorrect text in mbrlabel(8) man page [patch included]



>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:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 12 19:35:00 +0000 2012
>Originator:     Bug Hunting
>Release:        NetBSD 6.99.15
>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--

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


Home | Main Index | Thread Index | Old Index