Disklabel

from Wikipedia, the free encyclopedia

Disklabels are used on BSD- based operating systems such as DragonFly BSD , FreeBSD , macOS , NetBSD , OpenBSD or SunOS to divide data media into so-called partitions . Disklabels were introduced with BSD 4.3-Tahoe in 1988. The term partition is not to be understood as part of a partition table , since disklabel itself can be embedded in a partition. BSD disklabels are changed and created with the programs disklabel , disklabel64 or bsdlabel .

functionality

Place and conflicts

Initially, the disc labels were stored in the first sector of the data carrier. However, this method only works if only one operating system has to work on the computer, so this method is incompatible with the method of using an MBR partition table. This method is used by competing operating systems such as Windows or Linux . There is also a partition table in the first sector (→ boot sector ), the master boot record . A maximum of 4 partitions can be defined in it. Under Windows these are usually addressed with letters such as C :, D :, E: etc., under Linux-based systems with / dev / sdxy (for SATA and SCSI ) or / dev / hdxy (for IDE ), where x is Drive represents and y represents the partition. For example: The second partition on the first SATA disk is / dev / sda2.

Numbering scheme

The device files are located under / dev on Unix systems . The first two or three letters are determined by the driver of the data carrier and the operating system; FreeBSD has the following prefixes:

  • IDE hard drives: ad or ada
  • SCSI , USB : there
  • Floppy drives: fd

These two prefixes are mainly used under OpenBSD:

  • IDE, SATA, MFM, ESDI: wd
  • SCSI, USB, SATA to AHCI , RAID controller: sd

This prefix is ​​followed by the number of the hard disk, which differs depending on the operating system: FreeBSD uses the installation order, so that you may have two hard disks ad0 and ad2; ad1 is left blank so as not to upset the order when adding a third plate. OpenBSD uses the order of detection.

Without an MBR, the letter of the disklabel partition is appended directly to the hard disk name, for example ad0a for the root partition. With MBR, the scheme gets a little more complicated. BSD operating systems call the MBR partitions slices (German: disks; synonymous with MBR partition). A slice can in turn contain BSD disklabel partitions, in which case the respective MBR partition has the type a5 hex (FreeBSD), a6 hex (OpenBSD) or a9 hex (NetBSD). A slice is now addressed using a name such as ad0s1a ; however, the numbering begins with 1, not with 0, as is the case with many other numbering schemes under Unix.

The numbering using slices has the following scheme: First the hard disk identifier, then s and a number from 1 to 4 to identify the slice (MBR partition). a is the number of the disklabel partition. The letters are assigned according to the following order:

Letter meaning
a The root partition (mount point /). The boot code is searched for here
b Swap partition
c Pseudo-partition; refers to the entire plate or slice
d Previously reserved, can now be used as a normal partition
e - h FreeBSD: Remaining partitions, e.g. B. / usr, / var, / home etc.
e - p OpenBSD: Remaining partitions, e.g. B. / usr, / var, / home etc.

Today, however, you often only find / dev / wd0a on modern OpenBSD systems; on FreeBSD systems, the first partition on the USB stick is usually / dev / da0a.

Examples

  • Second hard drive, second MBR partition, root partition: / dev / ad1s2a
  • USB stick, first MBR partition, root partition: / dev / da0s1a

Detachment

From version 9.0-RELEASE, FreeBSD prefers to use a GPT partitioning scheme, as this avoids the disadvantages of the MBR.

Individual evidence

  1. FreeBSD manpage : disklabel (5 ), accessed December 23, 2013
  2. DragonFly BSD manpage : DISKLABEL64 (8) (English)
  3. FreeBSD Handbook: Disk Device Names
  4. OpenBSD, FAQ 14: Disks and Partitions
  5. Archive link ( Memento of the original from May 17, 2012 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice.  @1@ 2Template: Webachiv / IABot / www.freebsd.org
  6. FreeBSD Handbook: Disk Organization