How to Resize a Virtual Disk of an Oracle Linux Guest VM in Oracle VM

W/ New Partition

1) Open the Oracle VM Manager console.

2) Switch to the “Servers and VMs” tab.

3) Select the server pool, server and guest VM.

4) Click on the “Stop” button.

5) Click on the “Edit” button.

6) Switch to the “Disks” tab.

7) Select a virtual disk.

8) Click on the “Edit a Virtual Disk” button.

9) Enter the new size in the “Size (GiB)” field.

10) Click on the “OK” button twice.

11) Click on the “Start” button.

12) Connect to the Oracle Linux guest VM.

13) Run fdisk:

fdisk /dev/xvda

14) Enter “n” to add a new partition.

15) Enter “p” to select the primary partition type.

16) Select a partition number.

17) Enter “w” to write changes and exit.

18) Restart the guest VM.

19) Create a new physical volume from the partition:

pvcreate /dev/xvda3

20) Add the physical volume to the default volume group:

vgextend vg_samplevm /dev/xvda3

21) Extend a logical volume by the free size of the volume group:

lvextend -l +100%FREE -r /dev/vg_samplevm/lv_root

W/o New Partition

1) Open the Oracle VM Manager console.

2) Switch to the “Servers and VMs” tab.

3) Select the server pool, server and guest VM.

4) Click on the “Stop” button.

5) Click on the “Edit” button.

6) Switch to the “Disks” tab.

7) Select a virtual disk.

8) Click on the “Edit a Virtual Disk” button.

9) Enter the new size in the “Size (GiB)” field.

10) Click on the “OK” button twice.

11) Click on the “Start” button.

12) Connect to the Oracle Linux guest VM.

13) Run fdisk:

fdisk /dev/xvda

14) Enter “d” to delete the existing partition.

15) Enter “n” to add a new partition.

16) Enter “p” to select the primary partition type.

17) Select a partition number.

18) Enter “w” to write changes and exit.

19) Restart the guest VM.

20) Resize the existing physical volume:

pvresize /dev/xvda2

21) Extend a logical volume by the free size of the volume group:

lvextend -l +100%FREE -r /dev/vg_samplevm/lv_root

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s