Each partition on a hard disk is independent of the other partitions. For example, you can divide a hard disk into two partitions to install two different operating systems. An operating system will use its own partition to store data, independent of any other partition on a hard disk.  

The various types of partitions in Linux are: 
 
· Primary partitions 
· Logical and extended partitions 
· Swap partitions 


Each type of partition is assigned a numeric code. This code is automatically generated and has a fixed value. For example, the numerical code of the swap partition is 0x82. 

Primary Partitions 
 
When a partition is created on a hard disk for the first time, it is called the primary partition. A hard disk can have a maximum of four primary partitions. From the primary partitions present on the hard disk, only one partition can be subdivided into logical partitions. The partition with the logical partitions is called the extended partition. You can subdivide an extended partition into a maximum of 63 subsections. 
 
The MBR stores the information about all the primary partitions, such as the size of the Partitions in terms of sectors, blocks, and cylinders, and the offset from the zeroth cylinder.

Logical and Extended Partitions :

A hard disk can be divided into a maximum of four primary partitions. Therefore, you can only install four operating systems on a computer. If you want to install more than four operating systems, divide the extended partition into logical partitions.  
 
A logical partition is similar to a primary partition. Each logical partition consists of a pointer that contains the address of the next logical partition. All the logical partitions of a hard disk need to be contiguous. 
 
The first sector of an extended partition contains a block of partition descriptor, which contains the information about all the logical partitions. Linux imposes a limit on the number of types of partitions on a hard disk and on the number of logical partitions on the hard disk.  

For example, the maximum number of partitions is 63 on an IDE disk and 15 on a SCSI disk.

Swap Partitions :

A process that runs on a system is allocated certain blocks of the RAM, which are known as pages. Linux identifies the pages that a process can access, and stores those pages in the RAM. When the number of processes that run on a computer increases, the kernel releases the space on the RAM. To do this, the kernel writes the inactive pages back to the hard disk. The storage area of the hard disk where the inactive pages are written back is known as the swap space.  
 
You can specify a swap space as a swap partition, swap file, or a combination of a swap partition and a swap file. A swap partition is a separate division of a hard disk used for storing the pages that are written back from the RAM. A swap file is an ordinary file and is used by an operating system to store the inactive pages from the memory

Created by Amit Maheshwari
 
Top
Maintained By Amit Maheshwari