Resize Linux VM with Premium Disk

By default Linux VMs come with 30GB of disk space, inspite of selecting Premium Disk. Hence there are a few steps that must be followed to resize it to the desired capacity of Premium Disk (128GB/512GB/1TB).

Step 1: Select required premium disk size

1 – Stop the VM
2 – Select Disks under the VMs blade.
3 – Select the OS disk to load a new Premium Disks blade.
4 – Choose the desired size.
5 – Click Save.

Step 2: Resize disk capacity from the OS

1 – Start the VM
2 – At the linux prompt perform the following commands
a – sudo su
b – df -h (to find filesystem name, for example: /dev/sda1)
c – fdisk /dev/sda
d – u
e – p
f – d
g – n
h – 1
i – a
j – 1
k – p
l – wr
m – reboot
n – resize2fs /dev/sda1
o – df -h to reverify

Sangram has written 77 articles