Partition (computing)

In computer engineering, hard disk drive partitioning is the creation of logical divisions upon a hard disk that allows one to apply operating system-specific logical formatting.

Disk partitioning is a simple technique which can be viewed as a precursor of Logical volume management.

Contents

Purpose

Partitioning allows one to have multiple filesystems on a single hard disk. There are many reasons to do this including:

  • Technical limitations of a filesystem or operating system (e.g. old versions of the Microsoft FAT filesystem or old linux kernals that can't boot on a partion with more than 1024 sectors)
  • If one partition becomes corrupt, only that partition suffers and not your whole hard drive.
  • On some OSes, e.g. Linux, the swap file is normally a partition of its own. When it is, systems with a dual boot configuration can make several OSes use the same swap partition and therefore save disk space.
  • To prevent overgrown log or other files from making the whole computer unusable, they are put on their own partition. Then only one partition will run out of space.
  • Often, two operating systems cannot coexist on the same partition, or use different "native" disk formats. The drive is partitioned into different logical disks for different OSes.
  • The speed of the harddrive is partially dependent on the cluster size. For some filesystem types, smaller partitions on one physical harddrive decrease the cluster size (because cluster size is directly proportional to partition size for those filesystem types), thus helping increase read and write speed.

Implementions

Numerous partitioning schemes have appeared during the years, for almost all computer architectures in existence. Many of them are relatively transparent and allow convenient manipulation of the disk partitions; some however are obsolete in design and are accompanied by numerous quirks.

IBM PC (or clone)

History

The partition table, as used in the IBM PC architecture, was first devised in 1982, when hard drives were coming into use. In 1987 with DOS 3.3, an expansion of this format that provided for extended partitions which can contain logical partions.

Specifics

The partition table is located in the master boot record on the disk. The master boot record is the first sector on a disk. The partition table consists of 64 bytes. There are 4 partition table entries. Each is 16 bytes in length.

The partition table starts at offset (Hexadecimal) 0x1BE. Each partition table entry is 16 bytes in length so.

Master Boot Record
(offset)
0x0000 to 0x01BD - First 446 bytes
0x01BE to 0x01CD - Partition entry 1
0x01CE to 0x01DD - Partition entry 2
0x01DE to 0x01ED - Partition entry 3
0x01EE to 0x01FD - Partition entry 4
0x01FE to 0x01FF - Boot signature

The two byte master boot record signature at the end tells your computer that this is the boot sector. On some computers the operating system will not boot if the boot signature is not present in the master boot record.

Each partition table entry has the following arrangement...

|==========================================================|
| Byte Count | Description of contents                     |
|==========================================================|
|     1      | Boot indicator (0x00 for off, 0x80 for on)  |
|==========================================================|
|     3      | Starting head, cylinder and sector          |
|==========================================================|
|     1      | Filesystem descriptor                       |
|==========================================================|
|     3      | Ending head, cylinder and sector            |
|==========================================================|
|     4      | Starting sector (relative to disk beginning)|
|==========================================================|
|     4      | Number of sectors in partition              |
|==========================================================|

Sample partition table entry... (please also keep in mind that all bytes are in little endian)

offset: value                  explanation
======: =====                  ===========
0x01BE: 0x80                   bootable flag (0x00 for flag off, 0x80 for on)
0x01BF: 0x00 0x02 0x00         starting head, cylinder and sector
0x01C2: 0x83                   filesystem descriptor
0x01C3: 0x1A 0x5B 0x8C         ending head, cylinder and sector
0x01C6: 0x02 0x00 0x00 0x00    starting sector (relative to beginning of disk)
0x01CA: 0x00 0x35 0x0C 0x00    number of sectors in partition

CHS

The CHS (cylinder, head, sector) area of a partition table entry can be confusing. The easiest way to address these values is in binary...

CHS format:
===========
first 8 bits -> head
next 2 bits  -> first 2 bits of cylinder
next 6 bits  -> sector (remember sectors start at 1)
last 8 bits  -> last 8 bits of cylinder

Example...

00000000 00 000010 00000000 -> starting

starting head     = 0 (00000000)
starting cylinder = 0 (0000000000)
starting sector   = 2 (000010)

00011010 01 011011 10001100 -> ending

ending head     = 26  (00011010)
ending cylinder = 396 (0110001100)
ending sector   = 27  (011011)

Active Partition

The Bootable Flag Determines the active partion. Only one partition can normally be active at a time. The active marker is used during boot: after the BIOS loads the MBR into memory and executes it, the MBR checks the partition table at its end, and locates the active partition. Then it proceeds to load the boot sector of that partition into memory and runs it. Usally a boot loader such as GRUB or NTLDR. Some operating systems require being installed on active partitions. For example, Microsoft Windows 2000 Professional marks its own partition active when it starts up. Thus NTLDR will run next time the system boots, even if the user intended to use another boot loader on a different partition.

Logical Partitions

Primary partions of which only 4 can be made per physical disk can be set to be extended partitions. Which are containers of logical partitions (a maximum of 24 each). Modern Operating Systems can use these partions the same as primary partions.

Other Partitioning Implementions

As the IBM PC architecture is extremely common, the partition tables are likely to stay for a while. However, a recent project of Intel and Microsoft developed for the IA-64 architecture (based around the Itanium or Itanium 2 CPU) called the Extensible Firmware Initiative (EFI) has a component called GUID Partition Table (GPT).

Partitioning Schemes

Microsoft Windows

With Windows the standard partitioning scheme is to create a single partition, the C: drive, where the operating system, data, and programs all reside. It is recommended, however, to create multiple partitions or use multiple hard drives where the first partition (C:) is stored on one partition with the rest of the partitions and/or drives allocated to applications and data. The "My Documents" folder, a "special folder" home directory, can be mounted to take up the entire free space on a separate partition.

UNIX Systems

For UNIX-based and UNIX-like operating systems, fancy partitioning creates separate partitions for /, /boot, /home, /tmp, /usr, /var, /opt and swap. This ensures that if one file system gets corrupted, the rest of the data (the other file systems) stay intact, minimizing data loss. This has the disadvantage of subdividing the drive into small, fixed-size partitions, so, for instance, a user can fill up their /home partition and run out of useable hard drive space, even though other partitions still have plenty of free space. A good implementation requires the user to predict how much space each partition will need; sometimes a difficult task. Typical desktop systems use the other convention; a "/" (root) partition containing the entire filesystem and a separate swap partition.

List of partition utilities

See also

External links

fr:Partition de disque dur nl:Partitie pl:Partycja (informatyka)

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools