1998-11-16 21:44:25 +03:00
|
|
|
.\" Copyright (C) 1998 Wolfgang Solfrank.
|
|
|
|
.\" Copyright (C) 1998 TooLs GmbH.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by TooLs GmbH.
|
|
|
|
.\" 4. The name of TooLs GmbH may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
1999-03-22 21:43:46 +03:00
|
|
|
.\" $NetBSD: mbrlabel.8,v 1.3 1999/03/22 18:44:01 garbled Exp $
|
1998-11-16 21:44:25 +03:00
|
|
|
.\"
|
|
|
|
.Dd November 15, 1998
|
|
|
|
.Dt MBRLABEL 8
|
1999-03-22 21:43:46 +03:00
|
|
|
.Os
|
1998-11-16 21:44:25 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm mbrlabel
|
1998-11-17 16:04:30 +03:00
|
|
|
.Nd generate incore disklabel from MBR label(s)
|
1998-11-16 21:44:25 +03:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Ar device
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
is used to generate an incore disklabel from the 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.
|
|
|
|
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.
|
|
|
|
.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 .
|
|
|
|
.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
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command appeared in
|
|
|
|
.Nx 1.4 .
|