LXC locked (disk) and can't clear it

stubbo66

New Member
Apr 2, 2024
16
1
3
I was relocating a root disk for an LXC to another drive as I'm getting wear issues and trying to isolate which VM/LXC is the culprit. But on one LXC that has a 300GB volume, I realised it was going to be offline for too long so hit the stop button in the UI.

That seemed to stop the move, but has left the LXC locked with the padlock symbol and (disk) as the description. No matter what I try I can't seem to clear it. Rescan seemed to do nothing.

Also, I see the Root disk now showing both on the original disk and on the target disk and I can't remove the target disk as it thinks it is associated to the VM still.

I seem unable to do anything with the VM, can't edit it, stop it, can't even remove it because of the disk lock.

Any ideas how to recover from this situation, I couldn't find any posts referring to a disk lock?

I should add, I even resorted to a full shutdown, but that hung proxmox and ended up hitting the reset button. When it restarted it's all in exactly the same state with the disk lock in place.
 
Last edited:
ok, I found
Code:
pct unlock 113
which removed the lock on the disk, but that left two disk images on two different volumes and neither can be removed as they both think they are the current volume.

The only way I could find to fix this was to delete the CTX and restore it from backup.

So I am sorted, but something is a bit flakey around the process of stopping a move of a disk image.
 
Hi @stubbo66

I am not able to replicate now, from my notes

- Stop machine qm stop VMID
- Edit nano /etc/pve/qemu-server/VMID.conf
- Find the line that corresponds to the disk you want to detach, example scsi0: local-lvm:vm-VMID-disk-0,size=10G
- remove disk, example rm /var/lib/vz/images/STORAGE/vm-VMID-disk-0.qcow2
- start machine qm start VMID

Hope it will help

Lukas