ARTICLES

ADDING A PHYSICAL VOLUME TO A LOGICAL VOLUME

Then extend the volume

 

#Note - if adding a virtual disk in VMWare server, boot the server with gparted live,
select the unallocated space, create new partition of the maximum size and select ext3 as the filesystem and do not specify a label.
Remove virtual iso and then reboot.

#If adding in ESX / ESXi server just turn the VM off, > Edit Settings and increase the disk size to whatever you want.

#Add the physical disk, in our case /dev/sda3. It is 24G and the current disk is also 24G.

#lvdisplay / df -h / fdisk -l will give you all the necessary information you require.

#In our case, the Logical Volume name is antares, the path is /dev/mapper/antares-root.

#First prepare the physical disk to be enabled so it can join the Logical Volume.

pvcreate /dev/sda3

#Next, extend the volume group to include the newly enabled disk.

vgextend antares /dev/sda3

#Now resize the underlying physical disks from 24G to 48G.

lvextend -L48G /dev/mapper/antares-root

#Finally, resize so the filesystem can recognize the newly extended space

resize2fs /dev/mapper/antares-root

 

 

Confirm it has extended Properly

#Now do a df -h to ensure that the filesystem can see the changes. In our case it went from:

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/antares-root
24G 8.3G 14G 38% /
tmpfs 994M 0 994M 0% /lib/init/rw
varrun 994M 96K 994M 1% /var/run
varlock 994M 0 994M 0% /var/lock
udev 994M 152K 994M 1% /dev
tmpfs 994M 0 994M 0% /dev/shm
lrm 994M 2.5M 992M 1% /lib/modules/2.6.28-17-server/volatile
/dev/sda5 228M 83M 134M 39% /boot

#to this

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/antares-root
48G 8.3G 37G 38% /
tmpfs 994M 0 994M 0% /lib/init/rw
varrun 994M 96K 994M 1% /var/run
varlock 994M 0 994M 0% /var/lock
udev 994M 152K 994M 1% /dev
tmpfs 994M 0 994M 0% /dev/shm
lrm 994M 2.5M 992M 1% /lib/modules/2.6.28-17-server/volatile
/dev/sda5 228M 83M 134M 39% /boot

 

Related Articles

Installing ESXi Patches for Spectre and Meltdown

Read More

Increasing the size of a Virtual Disk on VMWare Server

Read More