Linux Comm Fdisk
# Linux fdisk Command
[ Linux Command Manual](#)
Linux fdisk is a program for creating and maintaining partition tables. It is compatible with DOS-type partition tables, BSD, or SUN-type disk lists.
### Syntax
fdisk
**Required Parameters:**
* -l List all partition tables
* -u Use with **-l** to display the number of partitions
**Optional Parameters:**
* -s Specify a partition
* -v Version information
**Menu Operation Instructions**
* m : Display menu and help information
* a : Toggle the bootable flag
* d : Delete a partition
* l : List known partition types
* n : Create a new partition
* p : Print the partition table
* q : Quit without saving changes
* t : Change a partition's system ID
* v : Verify the partition table
* w : Write changes to disk and exit
* x : Extra functionality (experts only)
### Examples
Display current partition information:
# fdisk -lDisk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 1305 10377990 8e Linux LVM Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table
Display partition information for each SCSI hard disk:
# fdisk -lu Disk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System/dev/sda1 * 63 208844 104391 83 Linux/dev/sda2 208845 20964824 10377990 8e Linux LVM Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders, total 10485760 sectors Units = sectors of 1 * 512 = 512 bytes Disk /dev/sdb doesn't contain a valid partition table
[ Linux Command Manual](#)
YouTip