Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sbin/mbrlabel Pull up revisions 1.5-1.8 (requested by l...



details:   https://anonhg.NetBSD.org/src/rev/f606058d3353
branches:  netbsd-1-5
changeset: 490761:f606058d3353
user:      he <he%NetBSD.org@localhost>
date:      Mon Feb 26 22:30:44 2001 +0000

description:
Pull up revisions 1.5-1.8 (requested by lukem):
  Several fixes and enhancements:
   o only update in-core (and on-disk) disklabels if requested
   o be saner about adding MBR partitions to free disklabel slots
   o NTFS recognition
   o various cleanups

diffstat:

 sbin/mbrlabel/mbrlabel.8 |  83 ++++++++++++++++++++++++++---------------------
 1 files changed, 45 insertions(+), 38 deletions(-)

diffs (114 lines):

diff -r ff2f074018c7 -r f606058d3353 sbin/mbrlabel/mbrlabel.8
--- a/sbin/mbrlabel/mbrlabel.8  Mon Feb 26 22:30:25 2001 +0000
+++ b/sbin/mbrlabel/mbrlabel.8  Mon Feb 26 22:30:44 2001 +0000
@@ -27,65 +27,72 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\"    $NetBSD: mbrlabel.8,v 1.4 2000/03/15 11:55:34 fvdl Exp $
+.\"    $NetBSD: mbrlabel.8,v 1.4.4.1 2001/02/26 22:30:44 he Exp $
 .\"
-.Dd November 15, 1998
+.Dd December 27, 2000
 .Dt MBRLABEL 8
 .Os
 .Sh NAME
 .Nm mbrlabel
-.Nd generate incore disklabel from MBR label(s)
+.Nd update disk label from MBR label(s)
 .Sh SYNOPSIS
 .Nm
+.Op Fl fqrw
 .Ar device
 .Sh DESCRIPTION
 .Nm
-is used to generate an incore disklabel from the MBR label(s) found
+is used to update a
+.Nx
+disk label from the Master Boot Record (MBR) label(s) found
 on disks that were previously used on DOS/Windows systems (or
 other MBR using systems).
 .Pp
-The
 .Nm
-utility generates an incore label from the MBR contained in the very first
-block of the disk, then walking through every extended partition found
-and generating additional partition entries for the disk from the
-MBRs found in those extended partitions.
-The partitions are sequentially entered into the constructed disklabel
-as partitions
-.Em a , b
-and so on until no more MBR partitions are found or all available
-entries in the disklabel are used up.
+scans the MBR contained in the very first block of the disk,
+then walks through every extended partition found and generating
+additional partition entries for the disk from the MBRs found in
+those extended partitions.
+.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
+the first free partition slot in the disk label. A free
+partition slot is defined as one with an
+.Dv fstype
+of
+.Sq Li unused
+and a
+.Dv size
+of zero
+.Pq Sq 0 .
+If there are not enough free slots in the disk label, a warning
+will be issued.
+.Pp
 The raw partition (typically partition
 .Em c ,
 but
 .Em d
-on i386) is left alone during this process.
-The resulting disklabel is then placed as the incore disklabel for
-this disk.
-.Sh BUGS
-Due to the way disk drivers currently work in
-.Nx ,
-any incore disklabel is forgotten whenever the last partition of a
-disk is closed.
-Since typically you wouldn't have a partition open on a disk while
-running
-.Nm
-this lossage will most likely happen, if
-.Nm
-is used naively.
+on i386 and some othe platforms) is left alone during this process.
+.Pp
+By default, the proposed changed disk label will be displayed and no
+disk label update will occur.
+.Pp
+Available options:
 .Pp
-The workaround until the disk drivers are fixed is to keep the
-raw partition open until you access the partition(s) of the
-disk via e.g.
-.Xr mount 8 .
+.Bl -tag -width indent
+.It Fl f
+Force an update, even if there has been no change.
+.It Fl q
+Performs operations in a quiet fashion.
+.It Fl r
+Update both the in-core and the on-disk label if the in-core label has
+been changed.
+.It Fl w
+Update the on-disk label if it has been changed.
+.El
 .Pp
-E.g. you could use
-.Dl sleep 100</dev/rsd0c &
-.Dl mbrlabel sd0
-.Dl mount -t msdos /dev/sd0a /msdos
-to mount a disk containing only one DOS partition.
 .Sh SEE ALSO
-.Xr disklabel 8
+.Xr disklabel 8 ,
+.Xr fdisk 8
 .Sh HISTORY
 The
 .Nm



Home | Main Index | Thread Index | Old Index