Increasing partition , volume on linux VM

didraro

Active Member
Jan 25, 2014
62
0
26
I did install proxmox but i am not understanding why does not increase the partition space.

I did create a KVM centos7 and partition it is like this :


[root@cpanel ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 10G 0 part /boot
└─sda2 8:2 0 40G 0 part
├─centos_cpanel-root 253:0 0 30G 0 lvm /
└─centos_cpanel-swap 253:1 0 10G 0 lvm [SWAP]
sr0 11:0 1 1024M 0 rom
[root@cpanel ~]#

[root@cpanel ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.5M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/centos_cpanel-root 30G 1.4G 27G 5% /
/dev/sda1 9.8G 154M 9.1G 2% /boot
tmpfs 379M 0 379M 0% /run/user/0
[root@cpanel ~]#




How can i increase the / lvm partition . as uou can see it is 100 GB sda and the sda2 use only 40, so that need to be increased but i do not know how , i did try all steps but nothing worked. Can someone help me ?


Important it is not to lose the data from that partition .
 
Are you talking about a VM? You did increase the disk size already? Well then usually the steps inside the VM are to increase the size of the partition and then increase the logical volume to the max available space and after that resize the file system inside the logical volume.

How to resize the partition depends on the tool you use. I personally like parted which has the resizepart command.
For the logical volume have a look at lvextend -l +100%FREE /dev/volgroup/logical_volume. Resizing the file system should be possible with resize2fs /


Important it is not to lose the data from that partition .
Create a backup of the VM before you do anything that could end in disaster.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!