BSD Disklabel
   HOME

TheInfoList



OR:

In
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
-derived
computer A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations (computation) automatically. Modern digital electronic computers can perform generic sets of operations known as C ...
operating systems An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also inc ...
(including
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is a ...
,
OpenBSD OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project em ...
,
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
and
DragonFly BSD DragonFly BSD is a free and open-source Unix-like operating system forked from FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and FreeBSD developer between 1994 and 2003, began working on DragonFly BSD in Ju ...
) and in related operating systems such as
SunOS SunOS is a Unix-branded operating system developed by Sun Microsystems for their workstation and server computer systems. The ''SunOS'' name is usually only used to refer to versions 1.0 to 4.1.4, which were based on BSD, while versions 5.0 and l ...
, a disklabel is a record stored on a
data storage device Data storage is the recording (storing) of information (data) in a storage medium. Handwriting, phonographic recording, magnetic tape, and optical discs are all examples of storage media. Biological molecules such as RNA and DNA are conside ...
such as a
hard disk A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
that contains information about the location of the
partition Partition may refer to: Computing Hardware * Disk partitioning, the division of a hard disk drive * Memory partition, a subdivision of a computer's memory, usually for use by a single job Software * Partition (database), the division of a ...
s on the disk. Disklabels were introduced in the 4.3BSD-Tahoe release. Disklabels are usually edited using the utility. In later versions of FreeBSD, this was renamed as .


History

In historic Bell Labs and BSD Unix releases, disk partitioning was fixed, compiled into each device driver at the time the kernel was compiled. The fixed partitions overlapped, allowing the disk to be used with different layouts by careful selection of a non-overlapping subset of the partitions. This was not originally viewed as a problem because there were only a small number of disk drives supported by each driver, and Unix only ran on one vendor's hardware. The introduction of standardized disk interfaces — SMD, ESDI and
SCSI Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, electrical, optical and logical interface ...
— and a substantial market in third-party controllers and drives resulted in significant inconvenience, since a Unix system's operators would have to recompile the kernel in order to add an appropriate partition layout for every different disk they attached to a system. This also presented a problem for commercially licensed Unix vendors, as support engineers would have to recompile the kernel before installing upgrades on a customer's machine. For the 4.3-Tahoe release, which supported a non-
Digital Equipment Corporation Digital Equipment Corporation (DEC ), using the trademark Digital, was a major American company in the computer industry from the 1960s to the 1990s. The company was co-founded by Ken Olsen and Harlan Anderson in 1957. Olsen was president unt ...
platform, the CCI Power 6/32, Berkeley implemented a new partitioning scheme based on an on-disk data structure and the ''disklabel''(8) command. (Such on-disk partition maps were already well-known on other operating systems, and only the specific format, not the fact of partition labels generally, was invented by Berkeley.)


Where disklabels are stored

Traditionally, the disklabel was embedded in the first-stage
bootstrap loader In computing, booting is the process of starting a computer as initiated via hardware such as a button or by a software command. After it is switched on, a computer's central processing unit (CPU) has no software in its main memory, so so ...
, in the first sector or track of the disk, where the computer's firmware expected a boot loader to be. Having the label embedded in the boot loader meant that the loader did not itself need to contain code to locate and read the label from the disk. However, this system only works when the computer firmware simply loads and executes the boot loader without attempting to determine whether it is valid. In the world of
IBM PC compatible IBM PC compatible computers are similar to the original IBM PC, XT, and AT, all from computer giant IBM, that are able to use the same software and expansion cards. Such computers were referred to as PC clones, IBM clones or IBM PC clones. ...
s, disks are usually partitioned using the PC
BIOS In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is firmware used to provide runtime services for operating systems and programs and to perform hardware initialization during the ...
's master boot record (MBR) Partition Table scheme instead, and the BSD partitioning scheme is nested within a single, primary, MBR partition (just as the "extended" partitioning scheme is nested within a single primary partition with
extended boot record An extended boot record (EBR), or extended partition boot record (EPBR), is a descriptor for a logical partition under the common DOS disk drive partitioning system. In that system, when one (and only one) partition record entry in the master boot ...
s). Sometimes (particularly in FreeBSD), the primary MBR partitions are referred to as ''slices'' and the subdivisions of a primary MBR partition (for the nested BSD partitioning scheme) that are described by its disklabel are called ''partitions''. The BSD disklabel is contained within the volume boot record of its primary MBR partition. The MBR partition IDs for primary partitions that are subdivided using BSD disklabels are (386BSD and FreeBSD), (OpenBSD), (NetBSD), and (DragonFly BSD).DragonFly BSD commit 794d80a
Change legacy MBR partition type from 0xA5 to 0x6C
/ref> This format has a similar goal as the extended partitions and logical partition system used by MS-DOS, Windows and Linux. The same PC hard drive can have both BSD disklabel partitions and the MS-DOS type logical partitions in separate primary partitions. FreeBSD and other BSD operating systems can access both the BSD disklabel subdivided partition and the MS-DOS type Extended/Logical partitions.


The contents of disklabels

BSD disklabels traditionally contain 8 entries for describing partitions. These are, by convention, labeled alphabetically, 'a' through to 'h'. Some BSD variants have since increased this to 16 partitions, labeled 'a' through to 'p'. Also by convention, partitions 'a', 'b', and 'c' have fixed meanings: * Partition 'a' is the "root" partition, the volume from which the operating system is bootstrapped. The boot code in the Volume Boot Record containing the disklabel is thus simplified, as it need only look in one fixed location to find the location of the boot volume; * Partition 'b' is the "
swap Swap or SWAP may refer to: Finance * Swap (finance), a derivative in which two parties agree to exchange one stream of cash flows against another * Barter Science and technology * Swap (computer programming), exchanging two variables in t ...
" partition; * Partition 'c' overlaps all of the other partitions and describes the entire disk. Its start and length are fixed. On systems where the disklabel co-exists with another partitioning scheme (such as on PC hardware), partition 'c' may actually only extend to an area of disk allocated to the BSD operating system, and partition 'd' is used to cover the whole physical disk.


See also

*
Master Boot Record A master boot record (MBR) is a special type of boot sector at the very beginning of partitioned computer mass storage devices like fixed disks or removable drives intended for use with IBM PC-compatible systems and beyond. The concept of MBR ...
(MBR) *
Extended Boot Record An extended boot record (EBR), or extended partition boot record (EPBR), is a descriptor for a logical partition under the common DOS disk drive partitioning system. In that system, when one (and only one) partition record entry in the master boot ...
(EBR) *
GUID Partition Table The GUID Partition Table (GPT) is a standard for the layout of partition tables of a physical computer storage device, such as a hard disk drive or solid-state drive, using universally unique identifiers, which are also known as globally unique i ...
(GPT) *
Boot Engineering Extension Record The host protected area (HPA) is an area of a hard drive or solid-state drive that is not normally visible to an operating system. It was first introduced in the ATA-4 standard CXV (T13) in 2001. How it works The IDE controller has registers ...
(BEER) * Apple Partition Map (APM) *
Rigid Disk Block In computing, a rigid disk block (RDB) is the block on a hard disk where the Amiga series of computers store the disk's partition and filesystem information. The IBM's PC equivalent of the Amiga's RDB is the master boot record (MBR). Unlike it ...
(RDB)


References

* *


Further reading

* {{cite web, url=http://www.onlamp.com/pub/a/bsd/2002/06/27/Big_Scary_Daemons.html, title=Understanding FreeBSD Disklabels, author=Michael W. Lucas, archive-url=https://web.archive.org/web/20170623130942/http://www.onlamp.com/pub/a/bsd/2002/06/27/Big_Scary_Daemons.html, archive-date=2017-06-23 BSD software Disk partitions Unix file system technology