| DISKLABEL(8) | System Manager's Manual | DISKLABEL(8) | 
disklabel —
| disklabel | [ -ACDFmnrtv] [-Bendian] [-Lsector] [-Mmachine] [-Ooffset] [-Psize] disk | 
| disklabel | -e[-CDFImnrv]
      [-Bendian]
      [-Lsector]
      [-Mmachine]
      [-Ooffset]
      [-Psize]
      disk | 
| disklabel | -i[-DFImnrv]
      [-Bendian]
      [-Lsector]
      [-Mmachine]
      [-Ooffset]
      [-Psize]
      disk | 
| disklabel | -R[-DFmnrv]
      [-Bendian]
      [-Lsector]
      [-Mmachine]
      [-Ooffset]
      [-Psize]
      disk protofile | 
| disklabel | -w[-DFmnrv]
      [-Bendian]
      [-Lsector]
      [-Mmachine]
      [-Ooffset]
      [-Psize]
      [-fdisktab]
      disk disktype
      [packid] | 
| disklabel | [ -NW] disk | 
| disklabel | -l | 
disklabel can be used to install, examine, or modify the
  label on a disk drive or pack. When writing the label, it can be used to
  change the drive identification, the disk partitions on the drive, or to
  replace a damaged label.
The -e, -i,
    -l, -N,
    -R, -W, and
    -w options determine the basic operation. If none
    are specified the label is displayed.
-eEDITOR) and write
      it back to the disk. If EDITOR is undefined, then
      vi(1) is used.-i-l-N-R-W-wThe majority of the rest of the options affect more than one form of the command:
-Adisklabel -D. Implies
      -r.-B
    endian-C-e or
      -R flags.-D-r. If -D is specified
      without a request to write the label, then existing labels are just
      deleted.-F-F is specified. Implies
      -r.-f
    disktab-I-r.-L
    sectorDISKLABELSECTOR.-M
    machine-B,
      -L, -m,
      -n, -O, and
      -P.-m-n-O
    offsetDISKLABELOFFSET.-P
    size-r-F.-t-v-v more than
      once will increase the verbosity.On systems that expect to have disks with MBR partitions (see
    fdisk(8))
    disklabel will find, and update if requested, labels
    in the first 8k of type 169 (NetBSD) MBR labels and
    within the first 8k of the physical disk. On other systems
    disklabel will only look at the start of the disk.
    The offset at which the labels are written is also system dependent.
disklabel will detect byteswapped labels,
    but currently cannot display them.
Previous versions of disklabel could
    update the bootstrap code on some architectures. This functionality has been
    subsumed by
    installboot(8).
disklabel is set to indicate any
  errors or warnings. The values used are:
disklabel utility has completed
    successfully.disklabel
  sd0Display the in-core label for sd0 as obtained via /dev/rsd0c.
disklabel -i -r
  sd0Read the on-disk label for sd0, edit it using the built-in interactive editor and reinstall in-core as well as on-disk.
disklabel -i -I
  sd0As previous, but do not fail if there was no label on the disk yet; provide some default values instead.
disklabel -e -I
  sd0As previous, only edit using $EDITOR
disklabel -w -r
  /dev/rsd0c sd2212 fooCreate a label for sd0 based on information for
    “sd2212” found in /etc/disktab, using
    foo as the disk pack label. If you do not have an
    entry for your disk in /etc/disktab, you can use
    this style to put an initial label onto a new disk. Then dump the label to a
    file (using disklabel sd0 > protofile), editing
    the file, and replacing the label with disklabel -R sd0
    protofile.
disklabel -R sd0
  mylabelRestore the on-disk and in-core label for sd0 from information in mylabel.
disklabel utility appeared in
  4.3BSD-Tahoe.
disklabel structure stored on disk cannot support
  partitions/disks greater than 2TB. Please use
  gpt(8) and
  dkctl(8) to manage partitions and
  disks larger than 2TB.
If the disk partition is not specified in the disk name (i.e.,
    xy0 instead of /dev/rxy0c),
    disklabel will construct the full pathname of the
    disk and use the “d” partition on i386, hpcmips, or arc, and
    the “c” partition on all others.
On the sparc, sparc64, sun2, and sun3 NetBSD systems, the size of each partition must be a multiple of the number of sectors per cylinder (i.e., each partition must be an integer number of cylinders), or the boot ROMs will declare the label invalid and fail to boot the system.
In addition, the -r option should never be
    used on a sparc, sparc64, sun2, or sun3 system boot disk - the
    NetBSD kernel translates the
    NetBSD disk label into a SunOS compatible format
    (which is required by the boot PROMs) when it writes the label. Using the
    -r flag causes disklabel to
    write directly to disk, and bypass the format translation. This will result
    in a disk label that the PROMs will not recognize, and that therefore cannot
    be booted from.
The -m flag previously toggled between
    using an MBR and not using an MBR, with the default being implied by the
    machine type. It now always enables MBR mode, independent of the machine
    default. Use the -n flag to disable MBR mode.
| July 2, 2019 | NetBSD 10.1 |