Table of Contents

File System - Partition table (Sector 0)

About

A partition table is data that holds partition division information.

The partition table is stored within the Master Boot Record of the disk (found in the first sector (0) of the disk)

Partition table is also known as:

Windows Disk

Syntax (or type, structure)

GUID Partition Table (GPT)

GUID Partition Table (GPT) is a standard for the layout of the partition table.

BSD/SUN type

A BSD/SUN type disklabel can describe 8 partitions, the third of which should be a âwhole diskâ partition. Do not start a partition that actually uses its first sector (like a swap partition) at cylinder 0, since that will destroy the disklabel.

IRIX/SGI type

An IRIX/SGI type disklabel can describe 16 partitions, the eleventh of which should be an entire “volume” partition, while the ninth should be labeled “volume header”. The volume header will also cover the parti- tion table, i.e., it starts at block zero and extends by default over five cylinders. The remaining space in the volume header may be used by header directory entries. No partitions may overlap with the volume header. Also do not change its type and make some file system on it, since you will lose the partition table. Use this type of label only when working with Linux on IRIX/SGI machines or IRIX/SGI disks under Linux.

DOS type

A DOS type partition table can describe an unlimited number of partitions. In sector 0 there is room for the description of 4 partitions (called “primary”). One of these may be an extended partition; this is a box holding logical partitions, with descriptors found in a linked list of sectors, each preceding the corresponding logical partitions. The four primary partitions, present or not, get numbers 1-4. Logical partitions start numbering from 5.

In a DOS type partition table the starting offset and the size of each partition is stored in two ways: as an absolute number of sectors (given in 32 bits) and as a Cylinders/Heads/Sectors triple (given in 10+8+6 bits). The former is OK - with 512-byte sectors this will work up to 2 TB. The latter has two different problems. First of all, these C/H/S fields can be filled only when the number of heads and the number of sectors per track are known. Secondly, even if we know what these numbers should be, the 24 bits that are available do not suffice. DOS uses C/H/S only, Windows uses both, Linux never uses C/H/S.

Management

Editor

View

fdisk

Linux - fdisk - Partition table manipulator

p
Disk /dev/sda: 68.7 GB, 68719476736 bytes, 134217728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x0008c758

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    67108863    33041408   83  Linux

Parted

The partition information are available with the print command of parted. start parted.

(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 376GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  107MB   107MB   primary  ext3         boot
 2      107MB   21.5GB  21.4GB  primary               lvm


In the header:

In the partition table: