Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== List Create Delete Partitions On Mbr And Gpt Disks ====== **General Information** * Disks with a MBR (master boot record) are limited to 4 primary partitions and 2TB max usable size. * Use fdisk or parted. * Disks with GPT lift both of these restrictions. * Use gdisk or parted. ---- ==== MBR ==== List MBR partitions <code bash> fdisk -l /dev/sdb </code> \\ Create MBR partitions <code bash> 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 </code> \\ Change partition type <code bash> fdisk /dev/sdb t selected partition: 1 Hex code: 83 (linux) w </code> \\ Delete MBR partitions <code bash> fdisk /dev/sdb d Partition number: 1 w </code> ---- ==== GPT ==== List GPT partitions <code bash> gdisk /dev/sdb p (print partition table) </code> \\ Create GPT partitions <code bash> 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 </code> \\ Delete GPT partitions <code bash> gdisk /dev/sdb d Partition number (if more than one):2 w </code> ---- ==== Re-read Partition Table ==== Sometimes, after you create a new partition and write changes, you could see this message: <code bash> OK; writing new GUID partition table (GPT) to /dev/xvdf. Warning: The kernel is still using the old partition table. The new table will be used at the next reboot. The operation has completed successfully. </code> \\ Instead of rebooting, inform the kernel that changes have been made on the disk: <code bash> partprobe /dev/xvdf </code> ---- linux_wiki/list_create_delete_partitions_on_mbr_and_gpt_disks.txt Last modified: 2019/05/25 23:50(external edit)