MBRLABEL(8)

NAME
mbrlabel - generate incore disklabel from MBR label(s)

SYNOPSIS
mbrlabel device

DESCRIPTION
mbrlabel 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).

The mbrlabel 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 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 c, but d on i386) is left alone during this process. The resulting disklabel is then placed as the incore disklabel for this disk.

BUGS
Due to the way disk drivers currently work in NetBSD, 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 mbrlabel this lossage will most likely happen, if mbrlabel is used naively.

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. mount(8).

E.g. you could use
    sleep 100</dev/rsd0c &
    mbrlabel sd0
    mount -t msdos /dev/sd0a /msdos
to mount a disk containing only one DOS partition.

SEE ALSO
disklabel(8)

HISTORY
The mbrlabel command appeared in NetBSD 1.4.