March 18, 20242 yr I have a windows 11VM on a dedicated 1TB SSD. For some reason. The VM keeps freezing and the free space shows 16KB on the drive under shares, in the VM however it's only showing 630GB of used space. Why is the file size so much larger than the used size and why isn't it shrinking automatically and is there a way to shrink/compress the file manually?
March 18, 20242 yr Is the drive passed through or does it hold a vdisk? if vdisk what's the set size?
March 18, 20242 yr Author 5 minutes ago, Kilrah said: Is the drive passed through or does it hold a vdisk? if vdisk what's the set size? It's set Primary vDisk Location: Auto /mnt/user/domains/Windows 11/vdisk1.img The img is on it's own ssd for only vm purpose. Not sure if that answers the question.
March 18, 20242 yr This may help https://forums.unraid.net/topic/51703-vm-faq/?do=findComment&comment=557606
March 18, 20242 yr Author 36 minutes ago, JorgeB said: This may help https://forums.unraid.net/topic/51703-vm-faq/?do=findComment&comment=557606 I'm trying to find a way to run a command to unmap on my existing vm.img and can't seem to find the proper command. But shouldn't it be doing this automatically already?
March 18, 20242 yr Author I've gone into scheduler and ran TRIM. I got back no space on the vm drive. Out of ideas here and need this working as soon as possible.
March 18, 20242 yr 31 minutes ago, dzyuba86 said: But shouldn't it be doing this automatically already? No. 16 minutes ago, dzyuba86 said: I've gone into scheduler and ran TRIM. I got back no space on the vm drive. Out of ideas here and need this working as soon as possible. You need to trim de vdisk by running Windows defrag, after making that change, trimming the SSD won't do anything.
March 18, 20242 yr You haven't answered what size the vdisk has been set to. If the drive is 1TB but you've set the vdisk size to 2TB then the VM can attempt to write beyond the 1TB mark, which would require the vdisk becoming larger than 1TB, but it can't since the drive is 1TB. The vdisk file itself will never shrink. Edited March 18, 20242 yr by Kilrah
March 18, 20242 yr Author 14 minutes ago, Kilrah said: You haven't answered what size the vdisk has been set to. If the drive is 1TB but you've set the vdisk size to 2TB then the VM can attempt to write beyond the 1TB mark, which would require the vdisk becoming larger than 1TB, but it can't since the drive is 1TB. The vdisk file itself will never shrink. The vdisk was set to the same size as the drive. But now it's not booting due to the drive having 0 free space. Maybe I need a better setup solution and just recreate the VM from scratch again?
March 18, 20242 yr Author 16 minutes ago, JorgeB said: No. You need to trim de vdisk by running Windows defrag, after making that change, trimming the SSD won't do anything. The VM won't boot as the vm drive has 0 free space. Is there anything I can do besides getting a larger drive to fix this? Or do I need to re-create the VM from scratch?
March 18, 20242 yr Author Or can I move the VM to the array, boot from array, defrag then move back to the ssd?
March 18, 20242 yr You can copy the VM to the array, then copy back with cp --sparse=always, that will "re-sparsify" the vdisk, then do the changes.
March 18, 20242 yr 33 minutes ago, dzyuba86 said: The vdisk was set to the same size as the drive Should always be set a bit smaller, or ideally since you're not going to share it with something else it should be passed through so there's no vdisk at all. You can copy to array, though note you need more than 1TB free on the specific drive you're going to copy it to.
March 18, 20242 yr Author 1 hour ago, Kilrah said: Should always be set a bit smaller, or ideally since you're not going to share it with something else it should be passed through so there's no vdisk at all. You can copy to array, though note you need more than 1TB free on the specific drive you're going to copy it to. I have an 88TB array. I think I'll be good.
March 18, 20242 yr Author 2 hours ago, JorgeB said: You can copy the VM to the array, then copy back with cp --sparse=always, that will "re-sparsify" the vdisk, then do the changes. Another newbie question. What is the most efficient way to do this?
March 19, 20242 yr Author 6 hours ago, JorgeB said: Use cp, mc won't make the new copy sparse, at least not AFAIK. So I did that. But even after running a defrag 3 times. The .IMG file is still much too large to boot into the VM without freezing mid boot.
March 19, 20242 yr If cp --sparse=always didn't shrink the vdisk, it means it's really using all that space, and that there are no holes/zeroes it can remove.
March 19, 20242 yr Author 19 hours ago, Kilrah said: Should always be set a bit smaller, or ideally since you're not going to share it with something else it should be passed through so there's no vdisk at all. You can copy to array, though note you need more than 1TB free on the specific drive you're going to copy it to. I'm making a new VM. But I don't get an option to do a disk passthrough.
March 19, 20242 yr Author 6 minutes ago, JorgeB said: If cp --sparse=always didn't shrink the vdisk, it means it's really using all that space, and that there are no holes/zeroes it can remove. I even uninstalled a few things to bring the size down to less than 400GB used in windows, It's still showing as over 900GB.
March 19, 20242 yr Author *UPDATE* Converting the .img to a physical disk. If that doesnt work I'm just making the vm fresh from scratch. All my files are in cloud backup anyways so I'm not losing anything but time
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.