[SOLVED] Unused ct disks that I can't remove

Lada

Member
Oct 23, 2019
13
0
21
45
Hello,

I have a problem with ct disks (unused I think) that I can't remove, and it's taking a lot of space.

I'm on PVE 6.3.3, I have a ct which is actually using one disk vm-103-disk-4. But I figured out that there are also old disks (vm-103-disk-0, vm-103-disk-1, vm-103-disk-2, vm-103-disk-3) on my local-lvm storage. It seems that those disks where created each time I resized the ct's disk.

The problem is that I can't delete then through the Web GUI, I have an error:
Cannot remove image, a guest with VMID '103' exists!
You can delete the image from the guest's hardware pane


I don't understand because they are unused ?

So I tried and could delete them through command :

lvremove /dev/data_vg/vm-103-disk-0

But then I made a backup then restored it and all those disks reappered.

So:

1-Why can't I remove then through Web GUI?
2-Why do they reappear after a restore?

Thank you for your help and to help me understand.
 
hi,

have you tried running pct rescan to find the unused disks? this will add them into the respective containers configuration as an unused disk, from there you should be able to remove them using the GUI
 
  • Like
Reactions: Michael.Uray
Thank you it worked, it added the unused disks in the container's config, then I could delete them from the web GUI in the ressources's page of the container.
Should I add a crontab every day to do: pct rescan ?
 
Thank you it worked, it added the unused disks in the container's config, then I could delete them from the web GUI in the ressources's page of the container.
great! please mark the thread [SOLVED] for reference :)

Should I add a crontab every day to do: pct rescan?
you shouldn't run into situations like this often, but it can still be worthwhile to add it.
be aware that running pct rescan will go through all the storages to find disks, with network storages it could be slow