linux_wiki:list_create_delete_partitions_on_mbr_and_gpt_disks

This is an old revision of the document!


List Create Delete Partitions On Mbr And Gpt Disks

General Information

About this page/how-to/script.


List MBR partitions

fdisk -l /dev/sdb

Create MBR partitions

fdisk /dev/sdb
m (help)
n (add new partition)
p (primary)
default (partition number)
first sector (default 2048)
last sector: +20G (to have a 20G partition)
w

Change partition type

fdisk /dev/sdb
t
selected partition: 1
Hex code: 83 (linux)
w

Delete MBR partitions

fdisk /dev/sdb
d
Partition number: 1
w

List GPT partitions

gdisk /dev/sdb
p (print partition table)

Create GPT partitions

gdisk /dev/sdb
n
default (partition number): 1
first sector (default 2048)
last sector: +20G (to have a 20G partition)
Hex code type: 8300 default
w

Delete GPT partitions

gdisk /dev/sdb
d
Partition number (if more than one):2
w

  • linux_wiki/list_create_delete_partitions_on_mbr_and_gpt_disks.1456799452.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)