How to Resize after increasing physical HDD size

cdsJerry

Renowned Member
Sep 12, 2011
204
8
83
I recently increased the size of the drives in my RAID system. I'm not very good at linux commands and I'm scared to death I'll do something stupid and delete my VM, which is critical to my small company. I could use some help with specific commands if possible. To be clear, I'm not trying to increase the size of the drive in the VM. I'm trying to increase the size of the drive where the VMs are stored.

I'm currently running Proxmox 3.1-24/060db5a6
I have a RAID drive which I boot to, and contains most of my stuff, including my VMs. I just increased it to a 2TB partition.
I have a second 2TB physical drive I use for storing backups on.
I have a NAS which I also use for storing backups on.
I used Gparted to increase my partition on the RAID boot drive to 2TB and to format a second partition on that drive of about 1.6TB that I'll probably use for something, but not sure what.

My problem is I don't know how to get Proxmox to use the 2TB drive. It still thinks it's 799GB according to the Summary page when I highlight the drive in the GUI. Using Putty I've gathered the following information, which may or may not be helpful.
***************************
root@live:~# pvscan
PV /dev/sdb2 VG pve lvm2 [2.00 TiB / 1.11 TiB free]
Total: 1 [2.00 TiB] / in use: 1 [2.00 TiB] / in no VG: 0 [0 ]
root@live:~# lvscan
ACTIVE '/dev/pve/swap' [7.00 GiB] inherit
ACTIVE '/dev/pve/root' [96.00 GiB] inherit
ACTIVE '/dev/pve/data' [811.80 GiB] inherit
root@live:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 10M 0 10M 0% /dev
tmpfs 1.6G 376K 1.6G 1% /run
/dev/mapper/pve-root 95G 1.9G 88G 3% /
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.2G 22M 3.2G 1% /run/shm
/dev/mapper/pve-data 800G 656G 144G 83% /var/lib/vz
/dev/sdb1 495M 101M 370M 22% /boot
/dev/sda1 1.8T 955G 786G 55% /backups
/dev/fuse 30M 16K 30M 1% /etc/pve
192.168.2.114:/mnt/pools/A/A0/Backups 1.8T 1.1T 768G 59% /mnt/pve/Backups-IO
******************************

I also get an error every day but as it's on a VM I built but never put into purpose I haven't spent much time trying to figure out what's wrong. "ERROR: Backup of VM 101 failed - volume 'Backups-IOMEGA:101/vm-101-disk-1.qcow2' does not exist"

I'm not sure what to do next and the fear of losing my data has me paralyzed. I looked at a support plan but if I did my math right, my 8 core machine running 2 VMs would cost me $4380 a year, more than buying physical machines for each VM.

Thank you in advance for help.
 
This is a problem that I will be needing to solve as well in the near future, so here are the basics:

- Proxmox local storage is based on an LVM volume group (VG) called "pve"
- First you need to resize the LVM physical volume (pv) with the pvresize command (check it's options with "man pvresize" and "pvresize --help")
- In this volume group, there are 3 logical volumes (LV), you want to increase the size of "/dev/pve/data"
- To resize an LV you must use the lvresize command (check it's options with "man lvresize" and "lvresize --help")
- After resizing the LV you will need to resize the "/var/lib/vz" filesystem as well (lvresize has a --resizefs option for that)
- You will need to be doing this booted to single user mode, so none of the services and guests are running

Search google, plan all steps ahead, and don't forget to backup all your data.
Hopefully others with hands-on experience will also contribute to this thread.
 
Last edited:

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!