Disk partitions in Linux
- In x86 architecture, there are maximum 4 primary partitions on a hard drive.
One of them can be of "extended" type and doesn't contain a file system, but can contain logical partitions. Say,
/dev/sda1 - primary
/dev/sda2 - extended
/dev/sda5 - logical
/dev/sda6 - logical
/dev/sda7 - logical
Max number of logical partitions is 12. Their sequence number can not be skipped, unlike that for the primary partitions.
fdisk, cfdisk, and parted can be used for partitioning a drive,
Each partition type is assigned a unique code, for example
0x06 - FAT
0x82 - Linux swap
0x83 - Linux filesystem
File systems can be created with mkfs command
To create a swap partition, use mkswap