Need to locate and delete detached disk

johnwhite_ca

New Member
Dec 16, 2021
7
0
1
Virtual Environment 7.0-8

The other day I was troubleshooting an issue where I could not start or delete VMs in my current production environment, which I've now resolved thanks to assistance provided in this forum.

However, during the process, I detached and removed a 500 GB add-on drive from one of the VMs that I was unable to start in order to free up space. By add-on, I simply mean that it was a blank storage drive secondary to the system (c:) drive.

After detaching and removing the drive, the storage was not reclaimed, and I didn't see anything in the GUI to help me locate and delete the detached disk. Once I had resolved the issue of not being able to delete VMs, I deleted the VM that initially had the 500 GB, and still no change in the storage. It appears that this 500 GB drive may be orphaned and I don't know the CMD line args well enough to find it myself.

Any assistance would be appreciated.
 
hi,

After detaching and removing the drive
detach -> makes disk unused
remove -> deletes disk

if you already hit remove on the "unused" disk, then the disk should be gone...

. It appears that this 500 GB drive may be orphaned
you can run qm rescan to see if the drive comes back into the config as "unused" disk.
otherwise you could also do something like: find / -name 'vm-*-disk-*' 2>/dev/null | grep VMID where VMID will be the ID of your VM ;)

I deleted the VM that initially had the 500 GB, and still no change in the storage
where do you check that?
 
Last edited:
hi,


detach -> makes disk unused
remove -> deletes disk

if you already hit remove on the "unused" disk, then the disk should be gone...
Normally when I detach and delete, I see the change instantly in the storage summary. 500 GB takes up 25% of my drive so it would be a noticeable change, but I didn't see it drop off at any point after I removed the drive or deleted the VM.

To support my thinking, the overall storage utilization is considerably more than the culmination of all allocated space in the (current) VMs in this node, by a few hundred GBs
you can run qm rescan to see if the drive comes back into the config as "unused" disk.
otherwise you could also do something like: find / -name 'vm-*-disk-*' 2>/dev/null | grep VMID where VMID will be the ID of your VM ;)
Since I the VM has been deleted, there's nowhere the drive could re-attach to.

I ran both commands with no results. The VMID was 750 and I haven't replaced the VMID with anything else. Maybe I structured the command incorrectly.
where do you check that?
Under the NODE > Storage > Summary tab
 
The VMID was 750 and I haven't replaced the VMID with anything else. Maybe I structured the command incorrectly.
should be fine, then most likely it was deleted...

what kind of storage was the VM using?
where's that storage mounted?

lsblk -f, df -h can be useful in identifying where that extra part is coming from.
for LVM(thin) you can check: lvs -a and for ZFS just do zfs list, otherwise with directory storage you should just see the disk file on the mountpoint with ls

if it doesn't show up anywhere i'm not sure where it could be unless it's on a shared storage that's not mounted anymore?

Under the NODE > Storage > Summary tab
have you tried refreshing the page, clearing browser cache etc? (just in case it's a visual bug).
 
OK, well, I ran every command and see all storage that's in use, and I haven't found any orphans as far as I can tell.

I can't really dispute these results so that's all I'm going to do with this right now. It takes the guesswork out of it for me, anyway.

Thanks for your assistance, oguz.

Have a great day!
 

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!