`fdisk` is a command-line tool for handling disk partitioning. It allows users to create, delete, and adjust disk partitions, as well as view detailed information about disk partition tables and partitions.
Examples
- Create a new partition table:
sudo fdisk /dev/sda
o
- Create a new primary partition:
sudo fdisk /dev/sda
n
p
1
[starting sector]
[ending sector]
- Create a new extended partition:
sudo fdisk /dev/sda
n
e
[starting sector]
[ending sector]
- Create a new logical partition:
sudo fdisk /dev/sda
n
l
[starting sector]
[ending sector]
- Display information about partition table:
sudo fdisk -l
sudo fdisk /dev/sda
d
[partition number]
sudo fdisk /dev/sda
w
- Display help information:
sudo fdisk -h