fdisk MBR GPT – 002 Disk Management – Part II – Creating partitions with fdisk

fdisk MBR GPT

 

fdisk -l   to display a list of devices

fdisk -l

 

/dev/sdb  no partition

/dev/sda  has 2 partitions

/dev/sdc no partition

 

fdisk /dev/sdb

m

let’s create a new MBR partition label

(we creaet 3 new p[artitions)

n – add a new partition

create primary partition

p primary

1  partition number

default  hit enter

insert +1G  – for 1 GB in size

Partition 1 of type Linux and of size 1GiB is set

t  change a partitions system id

l  list a partition

Partition 83 is Linux

for swap is 82 Linux swap

Hex code (type L to list all codes):   82

n

p

hit enter – the default is 2

hit enter –  accept the default

+20G  in size

 

and now the 3th partition

n

p

3

hit enter – mto create with all remaining space on the disk

p

Create 3 partition

sdb1  is first primary

other 2 are linux

w

The partition table has been alliterated!

 

Let’s create a GPT partition on /dev/sdc

fdisk /dev/sdc

p  <– check if exist any partition assigned ?

g  to create  GTP

n <–new partition

1

hit enter default – use the first available sector

p

create gpt partition

w – write

The partition table has been altered!

 

fdisk -l | less

partition created

 

and the last one big  partition

last partition created