How to resize/extend Windows or Linux disk space (LVM)

If you buy a plan with more than 15GB of disk space, the remaining space is empty and need to be partitioned first.

If you have Windows, you simply go to Computer Management -> Disk Management to reclaim the empty space.

If you have Centos template, you can use below instructions on how to extend the LVM to include the free space.

1. SSH and login as root to your VPS
2. type pvs then vgs then lvs (Note the name under VG, here we have centos)
3. fdisk /dev/vda
To Create new partition Press n.
Choose primary partition use p.
Choose which number of partition to be selected to create the primary partition.
Press 1 if any other disk available.
Change the type using t.
Type 8e to change the partition type to Linux LVM.
Use p to print the create partition ( here we have not used the option) (note the new partition, usually /dev/vda3).
Press w to write the changes.
4. Restart the system once completed.
5. Once up, SSH again to your VPS
6. type

vgextend centos /dev/vda3

6. type vgdisplay and note the number next to Free then say the number you see on left side of / is 40970
7. type df and note your / partition Filesystem name (say /dev/mapper/centos-root)
8. type

lvextend -l +40970 /dev/mapper/centos-root

If you need to reduce it, you type

lvreduce -l -40970 /dev/mapper/centos-root

9 Finaly step is to resize it via command

resize2fs /dev/mapper/centos-root

9. type df to see your new size for / partition

Cette réponse était-elle pertinente?

 Imprimer cet article

Consultez aussi

How to fix NoVNC Console Just Black Screen

Debian 5,6,7 This will also work in debian8 if you use sysv-init instead of systemd Editing the...

How to use Debian 8 OpenVPN

If you selected this New OpenVZ template, you just need to SSH to your assigned IP and login as...

How to add LAMP support to Ubuntu 14.0.4 64-bit on New OpenVZ

A LAMP (Linux, Apache, MySQL, PHP) stack is a common web stack used for hosting web content. This...

My Ubuntu template cannot SSH as root

If you have Ubuntu on your OpenVZ/LXC plans and you cannot login as root via SSH, it is because...

How to access Web Panel or VNC Console from Client Area (New KVM/OpenV/LXC)

NOTE: - If problems, use other web browser or try Private Window on your browser. - If you get...