Hits : 7814

GUID Partition Table – parted


lets assume that you want to create a new GPT[link1] layout on a disk.
From command line you can use parted[link2]

In the below example disk is 10Gb.

We will create a boot partition 128Mb, a root partition 8Gb and a swap partition with the rest size of the disk.

Contents


Select disk


parted
 
select /dev/sda
 
print




top

Create new layout


mklabel gpt  
print




top

Create Boot Parition


Select mebibyte for start – end size values

unit MiB


create a primary boot partition


mkpart primary ext2 1 129
name 1 bootfs


Make partition, bootable :

set 1 boot on




top

Create Root Partition


mkpart primary ext4 129 8321
name 2 rootfs




top

Create Swap Partition


give swap partition the rest avaliable size of the disk

mkpart primary linux-swap 8321 -1
name 3 swapfs




top

Verify your partition table


gdisk -l /dev/sda




top



Links
[link1] https://en.wikipedia.org/wiki/GUID_Partition_Table

[link2] https://www.gnu.org/software/parted/manual/parted.html