LVM-Thin error create vm and backup restore

rafafell

Renowned Member
Sep 24, 2016
64
2
73
38
I'm enabling lvm-thin, but I had trouble following the proxmox documentation (https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_lvm and https: //pve.proxmox. com / wiki / Storage: _LVM_Thin)

I did the following (first try):

# fdisk / dev / sdb >> to format in LVM and have two partitions (/ dev / sdb1 and / dev / sdb2)

# pvcreate --metadatasize 250k -y -ff / dev / sdb1 / dev / sdb2

# vgcreate vg01 / dev / sdb1 / dev / sdb2

# lvcreate -L 2,72T -n lv01 vg01

# mkfs.ext4 / dev / vg01 / lv01

# mkdir / var / lib / vz / lv01

# echo '/ dev / vg01 / lv01 / var / lib / vz / lv01 ext4 defaults 0 2' >> / etc / fstab

# lvconvert --type thin-pool vg01 / lv01
# mount / var / lib / vz / lv01


Then I added it in "Datacenter> Storage> Add type> LVM-Thin"


error when creating a vm:

Logical volume vg01 / lv01 contains a filesystem in use.
TASK ERROR: unable to create VM 101 - lvcreate 'pve05-vg01 / vm-101-disk-0' error: Aborting. Could not deactivate thin pool vg01 / lv01.

error while restoring a bkp

Logical volume pve05-vg01 / pve05-lv01 contains a filesystem in use.
no lock found trying to remove 'create' lock
TASK ERROR: command 'set -o pipefail && lzop -d -c /mnt/pve/fn01/dump/vzdump-qemu-102-2019_07_10-02_50_50.vma.lzo | vma extract -v -r /var/tmp/vzdumptmp11606.fifo - / var / tmp / vzdumptmp11606 'failed: lvcreate' pve05-vg01 / vm-100-disk-0 'error: Aborting. Could not deactivate thin pool pve05-vg01 / pve05-lv01.


###################################

The way it worked was as follows (second try):

# pvcreate --metadatasize 250k /dev/sdb1 /dev/sdb2

# vgcreate vg01 /dev/sdb1 /dev/sdb2

# lvcreate -T -l 100% FREE -n lv01 vg01

Then I added it in "Datacenter> Storage> Add type> LVM-Thin"

###############################

What did I miss while following the documentation to make these errors?

why on the second try lv does not appear in "df -h" and I do not need to format for ext4 and mount?

Best
 
pvcreate --metadatasize 250k -y -ff / dev / sdb1 / dev / sdb2
There is no need to split up the disk into 2 partitions and then put them in one single pv - just use the whole disk if you want to.
(you can also wipe the disk and create the LVM-Thin Storage via GUI -> 'Node' -> 'Disks' btw.)
# lvcreate -L 2,72T -n lv01 vg01
# mkfs.ext4 / dev / vg01 / lv01
Here you do create a regular lv and format it with a ext4 filesystem - this is not a thin-pool (see `man lvmthin`)

You can use this as a directory storage - just mount it via '/etc/fstab' and add it as directory storage to '/etc/pve/storage.cfg'

why on the second try lv does not appear in "df -h" and I do not need to format for ext4 and mount?
because here you did create a thin-pool - which in itself is not a filesystem, but a block-device (actually 2 lvms - one for data and one for metadata) - you can see how much is used etc. by the `lvs` command (see `man lvs`)

Please check out our reference documentation: https://pve.proxmox.com/pve-docs/chapter-pvesm.html

I hope this helps!
 
  • Like
Reactions: rafafell