dzyuba86 Posted March 18 Share Posted March 18 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? Quote Link to comment
Kilrah Posted March 18 Share Posted March 18 Is the drive passed through or does it hold a vdisk? if vdisk what's the set size? Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 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. Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 If it helps. I have auto trim and compression enabled. Quote Link to comment
JorgeB Posted March 18 Share Posted March 18 This may help https://forums.unraid.net/topic/51703-vm-faq/?do=findComment&comment=557606 Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 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? Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 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. Quote Link to comment
JorgeB Posted March 18 Share Posted March 18 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. Quote Link to comment
Kilrah Posted March 18 Share Posted March 18 (edited) 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 by Kilrah Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 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? Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 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? Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 Or can I move the VM to the array, boot from array, defrag then move back to the ssd? Quote Link to comment
JorgeB Posted March 18 Share Posted March 18 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. Quote Link to comment
Kilrah Posted March 18 Share Posted March 18 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. Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 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. Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 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? Quote Link to comment
dzyuba86 Posted March 18 Author Share Posted March 18 Update. Using MC via terminal to copy to a different drive. Quote Link to comment
JorgeB Posted March 19 Share Posted March 19 Use cp, mc won't make the new copy sparse, at least not AFAIK. Quote Link to comment
dzyuba86 Posted March 19 Author Share Posted March 19 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. Quote Link to comment
JorgeB Posted March 19 Share Posted March 19 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. Quote Link to comment
dzyuba86 Posted March 19 Author Share Posted March 19 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. Quote Link to comment
dzyuba86 Posted March 19 Author Share Posted March 19 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. Quote Link to comment
dzyuba86 Posted March 19 Author Share Posted March 19 *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 Quote Link to comment
dzyuba86 Posted March 19 Author Share Posted March 19 Finally resolved. Converting the .img into a passthrough disk worked. Quote Link to comment
Recommended Posts
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.