Cannot restore VM to newly created LV. Could Not Deactivate

rsvg

Member
Mar 23, 2021
20
0
6
42
I had to expand my root LV, so I deleted my LV data, and then expanded root, that went fine. This was the process:


Code:
sudo rm -rf /var/lib/vz

sudo lvremove /dev/pve/data -y

sudo lvcreate -y --zero n -l 100%FREE -T -c 256K -n data pve

sudo mkfs.ext4 /dev/pve/data

But now when I try to restore a backup to this new lvmthin, I get this error.

Code:
CTIME: Mon Apr 12 14:02:54 2021
  Logical volume pve/data contains a filesystem in use.
no lock found trying to remove 'create'  lock
TASK ERROR: command 'set -o pipefail && zstd -q -d -c /mnt/backups/dump/vzdump-qemu-102-2021_04_12-14_02_53.vma.zst | vma extract -v -r /var/tmp/vzdumptmp3050.fifo - /var/tmp/vzdumptmp3050' failed: lvcreate 'pve/vm-101-disk-0' error:   Aborting. Could not deactivate thin pool pve/data.


this is my storage.cfg:

Code:
dir: local
        path /var/lib/vz
        content iso,rootdir,vztmpl,backup
        prune-backups keep-last=2
        shared 0

lvmthin: local-lvm
        thinpool data
        vgname pve
        content rootdir,images
        nodes palm

dir: backups
        path /mnt/backups
        content vztmpl,rootdir,iso,snippets,images,backup
        nodes palm
        prune-backups keep-weekly=5
        shared 1
 
Last edited:
I was able to solve this by comparing my storage.cfg to the default and removing a line. I think you’re right I did have to recreate the lm without a file system but now I can’t remember. Thanks for the help.