Thursday, July 21, 2016

mbr vs gpt and how to convert to/from between them

MBR (Master boot recored) , GPT (GUID Partition Table)
- MBR is older, created in 1983
- MBR support only 4 primary partition, while GPT support unlimited partition, (Windows support 128)
- MBR support partition size only 2TB or less, while GTP support 9.4 * 10^9 TB

1- install packages that we need to use
$ sudo apt-get install parted gdisk

2- show the disk Partition Table whether they are mbr (msdos) or gpt
$ sudo parted -l
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 85.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  84.8GB  84.8GB  primary   ext4            boot
 2      84.8GB  85.9GB  1072MB  extended
 5      84.8GB  85.9GB  1072MB  logical   linux-swap(v1)


Model: ATA VMware Virtual S (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name              Flags
 1      1049kB  5370MB  5369MB  ext4         Linux filesystem


3- create a gpt partition on /dev/sdb
$ sudo gdisk /dev/sdb
- on gdisk shell type "n" for new partition and enter partition number, then start sector and end sector and finally the guid
then type "w" to save

4- if you have gpt and want to convert back to mbr use
$ sudo gdisk /dev/sdb
- on gdisk shell type "r" , then "g", then "w"

5- and if you have mbr partition table than want to change to gpt use:
$ sudo gdisk /dev/sdb
- on gdisk shell type "w"


-- screenshot of convert gpt to mbr

1 comment:

  1. Detailed article tutorials: http://www.aomeitech.com/partition-resource/convert-mbr-gpt-1234.html

    ReplyDelete