Create an additional lvm thin disk

sahostking

Renowned Member
Trying to create an additional disk but a bit lost by the term extents.

Here is what I did.

sgdisk -N 1 /dev/sdb
Creating new GPT entries.
The operation has completed successfully.

pvcreate --metadatasize 250k -y -ff /dev/sdb1
Physical volume "/dev/sdb1" successfully created.

vgcreate vmdata /dev/sdb1
Volume group "vmdata" successfully created

vgdisplay
--- Volume group ---
VG Name vmdata
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 976.95 GiB
PE Size 4.00 MiB
Total PE 250100
Alloc PE / Size 0 / 0
Free PE / Size 250100 / 976.95 GiB
VG UUID H2rOn5-2h0o-8q8c-Qi3t-YoMO-aOXF-9I5804

lvcreate -L 976.95G -n ssd-data vmdata
Rounding up size to full physical extent 976.95 GiB
Logical volume "ssd-data" created.

lvconvert --type thin-pool vmdata/ssd-data
WARNING: Converting logical volume vmdata/ssd-data to thin pool's data volume with metadata wiping.
THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert vmdata/ssd-data? [y/n]: y
Volume group "vmdata" has insufficient free space (0 extents): 31 required.

Should I leave some space available. How much? How does it work?
 
This is how i did it assuming sdc is the additional disk i partition it for LVM-Thin and another partition for the backup vms first created the backup partition

first convert the disk to gpt and choose letter g then w to save

Code:
fdisk /dev/sdc

then we partition the disk to what you want im going to use

Code:
cfdisk /dev/sdc

then you need to format the disk to ext4

Code:
mkfs.ext4 /dev/sdc1

then created folder

Code:
mkdir /backupvms

then mount it
Code:
mount -t ext4 /dev/sdc1 /backupvms

then after that i created the lvm-thin

Code:
sgdisk -N 2 /dev/sdc

after that really important to reboot the server

then after run this
Code:
pvcreate --metadatasize 250k -y -ff /dev/sdc2

then create the name
Code:
vgcreate vmdata /dev/sdc2

then we create the lvstorage

Code:
lvcreate -L 498G -T -n vmstore vmdata

then go to the webgui on the datastorage add the new volume group and thin pool

of course correct if im wrong (the experts in proxmox) because im somewhat new to proxmox

Hope this helps
 
  • Like
Reactions: ZipTX
Thanks. the method on here does work: https://pve.proxmox.com/wiki/Storage:_LVM_Thin

Its just the space allocation. How much space must be left free for extents. Not sure how to work that out. If I set it to 800GB it works fine but I want the full space (976.95G ) and I dont want any errors going forward when I start using the space for VMs.
 
Ok tried 960G works fine:

lvcreate -L 960G -n ssd-data vmdata
Logical volume "ssd-data" created.

lvconvert --type thin-pool vmdata/ssd-data
WARNING: Converting logical volume vmdata/ssd-data to thin pool's data volume with metadata wiping.
THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert vmdata/ssd-data? [y/n]: y
WARNING: Pool zeroing and large 512.00 KiB chunk size slows down provisioning.
Converted vmdata/ssd-data to thin pool.

Guess some GB must be free for some "stuff"
 

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!