Site map

Documentation

Partitions attributes

Partition identifiers

Each partition of your disk has an identifier. It’s written in the
partition table which is in the MBR if it’s a disk based on the standard
msdos partition table. This is just a number which says which sort of
partition it is. You can get the list of all the possible partition
identifiers that can be used in an msdos partition table by typing “L”
in fdisk under linux:

When you look at this table, you can see that there are 256 possible
identifiers. In general, they are written in hexadecimal because it
allows representing 256 different combinations with only two characters.
The partition identifier is supposed to be consistent with the contents
of the partition, but it’s not always correct. It’s perfectly possible
to install Linux on a partition having its identifier set to 7 which is
normally used for NTFS partitions. It’s more important to use the right
identifier if you want to install Windows. It may refuse to boot if you
use the wrong identifier for the partition. Anyway it should be correct
if you use a high-level partitioning tool such as parted. This
identifier is also very important if it’s an extended partition (types
5 and f). If you want to change the identifier of a partition
you have to use fdisk, and press “T” in the menu. It corresponds to
change a partition's system id

Here are the most important identifiers:

7: Normal NTFS (visible Windows partition)

17: Hidden NTFS (hidden Windows partition)

82: Linux swap (linux partition for swap)

83: Linux data (linux partition for data)

8e: Linux LVM (linux partition for LVM)

5: Extended partition (contains logical partitions)

f: Extended LBA partition (contains logical partitions)

Example of a typical partition table

Here is an example of a disk where both Linux and Windows are installed.
This is the way it looks in fdisk for linux:

Partition flags

Each partition may also have other attributes, also know as flags:

One partition of the disk may be marked as active/bootable

FAT/NTFS may be marked as hidden or visible

The bootable/active flag

The first flag is called either bootable or active. Only one
partition of the disk may have this flag. This flag is used to mark the
partition that contains the operating system that should be booted when
the computer starts using that disk. When the computer starts, the boot
code of the MBR is executed. By default the MBR contains the
conventional MBR code, which is used to automatically start the
operating system which is installed on the partition marked as active.
This is the typical situation of a computer when Microsoft
Operating-Systems are installed. Other boot managers can be installed in
the MBR boot code, such as Grub which is used to start Linux or Windows
(or any other Operating-System). These boot managers tend to ignore the
bootable/active flag since they have their own representation of the
installed systems. You can also install more than one version of Windows
on your disk if you have multiple primary partitions. This
bootable/active flag can be used to choose which one you want to boot.

The hidden flag

Partitions may be either visible or hidden. In reality the
Operating-System can always see the partition of the disk and it can
decide to ignore the partitions which are marked as hidden. You can hide
a partition if you don’t want this partition to be visible under
Windows. It can be used to hide data, or to be sure they won’t be
accidentally removed. You can clear this flag at any time using a
partitioning tool such as Parted or fdisk. In reality there is no such
flag in the partition table. FAT and NTFS partitions have multiple
identifiers so there is one identifier for a visible NTFS partition, and
another identifier is used for hidden NTFS partitions. Linux partition
don’t have such a hidden identifier but that’s not a real problem since
it’s possible to simply not mount a partition if you don’t want its
contents to be visible.

Disks and partition names

Linux and Windows have different naming conventions for disks and
partitions. Here is a description of how disk names are set under
Linux:

IDE/PATA disks names used to be /dev/hda (first disk), /dev/hdb
(second disk), … but can also be called sda, sdb, …

RAID arrays use other names such as /dev/cciss/c0d0p1 (HP
SmartArray raid controllers)

With traditional msdos/bios partition tablenumbers 1 to 4 are reserved for primary partitions (an extended
partition is a primary partition), and numbers from 5 are used for
logical partitions. Thus there can be a /dev/sda5 (first logical
partition inside the extended partition) even if there is no partition
called /dev/sda4:

/dev/sda1 is the first primary partition of the disk called
/dev/sda

/dev/sda2 is the second primary partition of the disk called
/dev/sda

/dev/sda5 is the first logical partition of the disk called
/dev/sda

/dev/sda6 is the second logical partition of the disk called
/dev/sda

If you are using the GPT disk layout then there is no need for
extended partitions, because there can be more than 4 primary partitions.
Then partitions are based on normal numbering starting at 1.

You can look at the file called /proc/partitions under Linux to see
your disks and partitions: