Fdisk is a partition table manipulator for Linux. Fdisk displays information about disk partitions, creates and deletes disk partitions, and changes the active partition. It is possible to assign a different operating system to each of the four possible primary partitions, though only one partition is active at any given time. You can also divide a physical partition into several logical partitions.
Usage
The basic fdisk commands you need are:
# a Toggle a bootable flag on current partition.
# b Edit disklabel of a BSD partition.
#c Toggle DOS compatibility flag.
#d Delete current partition.
# l List all partition types.
# m Main menu.
# n Create a new partition; prompt for more information.
# o Create an empty DOS partition table.
# p Print a list of all partitions and information about each.
# q Quit; do not save.
# t Replace the type of the current partition.
# u Modify the display/entry units, which must be cylinders or sectors.
# v Verify: check for errors, and display a summary of the number of unallocated sectors.
# w Save changes and exit.
# x Switch to expert commands.
Example
To list all partitions currently on the system:
$ fdisk -l
I start fdisk from the shell prompt:
$ fdisk /dev/sdb
Command (m for help): p
(p to print all partition)Command (m for help): d
(d to delete partitions)
Partition number (1-4): 1Command (m for help): n
(n to add partition)
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1Command (m for help): w
(w to write the table on the disk)


Pingback: Quick RAID0 and Drive Encryption on CentOS command line How To. | Linux Admins
Pingback: Cara Menambah dan mengecilkan ukuran Partisi Harddisk