m4f1050 Posted September 11, 2018 Share Posted September 11, 2018 (edited) Is there a way I can make my image file smaller after I uninstall several apps that take up a lot of space (or reset Windows 10 and start from scratch?) Maybe creating a new image from the original image (BUT somehow only copy data sectors and not free sectors?) Right now my image file is 110 gigs, it's set to grow, but I uninstalled a lot of apps and deleted a lot of install files and files that took a lot of space, and right now I am only using 50~60 gigs worth, not 110 gigs. Thanks! Edited September 11, 2018 by m4f1050 Quote Link to comment
JorgeB Posted September 11, 2018 Share Posted September 11, 2018 If you keep it sparse it will only use the actually used space, more info here. 1 Quote Link to comment
m4f1050 Posted September 13, 2018 Author Share Posted September 13, 2018 Awesome, just what I was looking for! Thanks! Quote Link to comment
bonienl Posted September 13, 2018 Share Posted September 13, 2018 In Unraid 6.5 this excellent idea of @johnnie.black is accomplished even easier. It is possible to change the vdisk bus format to SCSI from the GUI. The only 'manual' setting to add is discard='unmap' Quote Link to comment
JorgeB Posted September 13, 2018 Share Posted September 13, 2018 10 minutes ago, bonienl said: In Unraid 6.5 this excellent idea of @johnnie.black is accomplished even easier. It is possible to change the vdisk bus format to SCSI from the GUI. The only 'manual' setting to add is discard='unmap' Yes, I've been meaning to edit that entry, will try to do it soon. Quote Link to comment
JorgeB Posted September 13, 2018 Share Posted September 13, 2018 11 minutes ago, bonienl said: The only 'manual' setting to add is discard='unmap' Can this be a GUI option also for the feature or not easy to do? Quote Link to comment
bonienl Posted September 13, 2018 Share Posted September 13, 2018 2 minutes ago, johnnie.black said: Yes, I've been meaning to edit that entry, will try to do it soon. soon™ 1 minute ago, johnnie.black said: Can this be a GUI option also for the feature or not easy to do? Sure it is doable, you better make it a feature request so it won't get lost. Quote Link to comment
m4f1050 Posted September 13, 2018 Author Share Posted September 13, 2018 It worked on my Windows 10 VM. Now, will this work on Windows 2008 R2? ***FINGERS CROSSED*** Quote Link to comment
JorgeB Posted September 13, 2018 Share Posted September 13, 2018 25 minutes ago, m4f1050 said: Now, will this work on Windows 2008 R2? ***FINGERS CROSSED*** I believe it only works on Windows 8/10 and related server editions, 2012 and 2016, but not sure, let us know. Quote Link to comment
m4f1050 Posted September 14, 2018 Author Share Posted September 14, 2018 (edited) I ran defrag on Windows 2008R2 then I ran SDelete -z to simulate a "TRIM" by zeroing the free space Also I went ahead and took a further step, I reconverted the image with compression: mv win10.img win10.img.bak qemu-img convert -O qcow2 win10.img.bak win10.img mv win2k.img win2k.img.bak qemu-img convert -O qcow2 win2k.img.bak win2k.img Win 10 from a 135gigs image it compressed to a 58gigs image (the OS is using 95gigs) Win 2008R2 from a 130gigs image it compressed to a 60gigs image (the OS is using 63gigs) -- No trim, used SDelete from Sysinternals to zero empty sectors. Got another question, is the docker.img file QCOW2? Thinking about compressing that one too. 🙂 EDIT: ***DO NOT USE SDelete*** It made the image bigger. I did SDelete on the Win 10 and then compressed it and from 58gigs it went to 97gigs -- NOT WORTH IT -- I bet if I wouldn't have SDelete'd the Win 2k image it would've compressed even more. Adding a 2nd drive to each VM, cloning the drives then doing the qemu-img convet -O qcow2 and leaving them alone after that. Edited September 14, 2018 by m4f1050 Quote Link to comment
JorgeB Posted September 14, 2018 Share Posted September 14, 2018 On 9/13/2018 at 5:29 PM, bonienl said: On 9/13/2018 at 5:24 PM, johnnie.black said: Yes, I've been meaning to edit that entry, will try to do it soon. soon™ Done, also changed the way to install the SCSI controller so you only need to edit the XML to add "discard=unmap", everything else is done using the form view, also made the feature request about that so when done no need to use XML view at all. Quote Link to comment
m4f1050 Posted September 14, 2018 Author Share Posted September 14, 2018 16 minutes ago, johnnie.black said: Done, also changed the way to install the SCSI controller so you only need to edit the XML to add "discard=unmap", everything else is done using the form view, also made the feature request about that so when done no need to use XML view at all. I want to add to that... If you are already using VirtIO on Windows 2008 R2 (my case,) you need to add a Manual SCSI drive (1 meg should be ok, you can delete afterwards, just to get drivers installed first) then you can swap the type or your Windows 2008 R2 won't boot, it will blue-screen. After I created the 1 meg drive and booted and installed the drivers, I was able to switch from VirtIO to SCSI without blue-screen. Quote Link to comment
JorgeB Posted September 14, 2018 Share Posted September 14, 2018 I want to add to that... If you are already using VirtIO on Windows 2008 R2 (my case,) you need to add a Manual SCSI drive (1 meg should be ok, you can delete afterwards, just to get drivers installed first) then you can swap the type or your Windows 2008 R2 won't boot, it will blue-screen. After I created the 1 meg drive and booted and installed the drivers, I was able to switch from VirtIO to SCSI without blue-screen. Yep, that's the same procedure I changed it to, you can add a 2nd small vdisk or for example use the exiting OS install CD-rom if still present to install the SCSI driver. 1 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.