LVM storage used for containers

deranjer

Active Member
Dec 28, 2010
50
1
28
Decided to start from scratch on Proxmox 2.0 and decided to use LVM (didn't last time). Proxmox sets up a default LVM on the install drive (an 80 GB drive) so I added my 1TB drive to the LVM.

Code:
  --- Volume group ---
  VG Name               pve
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               1005.54 GiB
  PE Size               4.00 MiB
  Total PE              257417
  Alloc PE / Size       16584 / 64.78 GiB
  Free  PE / Size       240833 / 940.75 GiB

I then went and added the LVM using the web interface, however it appears I can only add images to the LVM? Can I just mount the LVM to /var/lib/vz? How should I use the LVM to store more than just Images?

Thanks.
 
I then went and added the LVM using the web interface, however it appears I can only add images to the LVM? Can I just mount the LVM to /var/lib/vz? How should I use the LVM to store more than just Images?

LVM is a block device, so you can only store Images there. If you want to store files, create a filesystem on top of a LV, and mount it somewhere. Then use it as 'Directory' type storage in PVE.
 
Hi,
you already add the second disk to the vg pve - so you don't have to assign lvm-storage in the storage menu. This is for adding further volumegroups.

Simply extend your logical volume /dev/mapper/pve-data (like "lvextend -L +500G /dev/mapper/pve-data; resize2fs /dev/mapper/pve-data").
Be sure that you leave min. 4GB space free in the VG for snapshots (backup).

Or, like Dietmar wrote" create an new logical-volume on vg pve with filesystem and mount this filesystem.

Udo
 
Hi,
you already add the second disk to the vg pve - so you don't have to assign lvm-storage in the storage menu. This is for adding further volumegroups.

Simply extend your logical volume /dev/mapper/pve-data (like "lvextend -L +500G /dev/mapper/pve-data; resize2fs /dev/mapper/pve-data").
Be sure that you leave min. 4GB space free in the VG for snapshots (backup).

Or, like Dietmar wrote" create an new logical-volume on vg pve with filesystem and mount this filesystem.

Udo

Thanks, I had tried the lvextend command, but since I don't really understand LVM :D didn't realize I had to resize2fs... after a large amount of research online finally just delete the entire /pve-data LV and created another LV that was the right size from the very beginning and reformatted the entire fs on it, now it seems to be working correctly.