Creating a small disk image

boing

Senior member
Sep 13, 2001
361
6
81
I want to create an image of my main C: (Win 7 64 bit). At the minute Windows is saying it will be 74GB which is doable but I'd like to get it down a little. I was thinking, if I disable system restore and the page file system temporarily (I've got 16GB RAM and therefore a big page file system) would that make the disk image smaller? in other words I'm asking are these things (pagefile and system restore files) included in an image?
 

ZeroRift

Member
Apr 13, 2005
195
6
81
This may depend on your imaging software, but in general: yes, those items are included in an image. Most imaging software includes compression options as well, so your image size will likely be quite a bit smaller.

I would also consider disabling / deleting the hibernation file, as well as clearing all of your temp folders. Be careful with your system restore points. If you disable system restore / delete all the restore points, you (obviously) won't be able to use that tool to recover until you take a new restore point.

Are you using the built in windows backup tools to create a .wim file? As I recall those aren't compressed by default....
 

boing

Senior member
Sep 13, 2001
361
6
81
Thanks for the feedback, yes I'm going with the Windows 7 system (first time at creating an image)

How do I go about activating compression?

My Hibernation is set to 'Never' in my power options, is there still a file cluster to be deleted after that?

I've just spent 4 days re-installing everything back on my drive after a few issues which is why I'm looking for a faster recovery option for the future, since it's all fresh I shouldn't lose much by deleting system restore and I can turn it back on after I'm finished.
 

corkyg

Elite Member | Peripherals
Super Moderator
Mar 4, 2000
27,370
240
106
My Hibernation is set to 'Never' in my power options, is there still a file cluster to be deleted after that?.

OK - if Hibernation is OFF, then check to see if in the root of C drive you have a file called hiberfil.sys. If so, you can delete it.
 

ZeroRift

Member
Apr 13, 2005
195
6
81
Check out imageX (M$ command line tool for creating .wim files) as it has the compression options you're looking for. There are tutorials online for creating custom images with it.

There are also third party imaging tools available out there, but I'm not familiar with the free ones (I've only used commercial tools for imaging).

I believe setting hibernation to 'Never' clears out the related files, but I always run "powercfg -H OFF" from an elevated prompt to make sure that feature isn't consuming space if I'm not going to use it.
 

ZeroRift

Member
Apr 13, 2005
195
6
81
Oh, as an aside, you should also consider running "sysprep /generalize" before you create the image. This will reset windows to a state where it will try to reinstall drivers the next time the system boots up, which can be useful if you need to restore the image to a new computer (in the case of catastrophic hardware failure). Taking an image after you've sysprep'd windows can be tricky since you will have to boot to a pre-environment to run imageX.

All the tools you need to do this can be found in the Windows Automated Installation Toolking (AIK), but the process can be a bit daunting if you don't have much experience.

This process is also totally optional for a backup image and would only help you if you had to load your backup onto a new set of hardware.
 
Oct 16, 1999
10,490
4
0
You can also run
dism /online /cleanup-image /spsuperseded
and
compcln.exe
from an admin cmd to clean up some redundant files, but google those commands to make sure you want to do them.
 

boing

Senior member
Sep 13, 2001
361
6
81
Thanks for the hiberfil.sys prompt, the file was still there after disabling hibernation but that killed it. (looked on the c: for the file but couldn't find anything)


Oh, as an aside, you should also consider running "sysprep /generalize" before you create the image. This will reset windows to a state where it will try to reinstall drivers the next time the system boots up, which can be useful if you need to restore the image to a new computer (in the case of catastrophic hardware failure). Taking an image after you've sysprep'd windows can be tricky since you will have to boot to a pre-environment to run imageX.

All the tools you need to do this can be found in the Windows Automated Installation Toolking (AIK), but the process can be a bit daunting if you don't have much experience.

This process is also totally optional for a backup image and would only help you if you had to load your backup onto a new set of hardware.

could you clarify that a little, I'm out of my depth at this point. I was under the impression you burnt a recovery disk along with the image which allowed you to re-install fairly easily, is this only onto the original hardware?
 

boing

Senior member
Sep 13, 2001
361
6
81
You can also run
dism /online /cleanup-image /spsuperseded
and
compcln.exe
from an admin cmd to clean up some redundant files, but google those commands to make sure you want to do them.

cheers Gonad, think I'll use the first one, seems to have the biggest capacity to free up space.
 

ZeroRift

Member
Apr 13, 2005
195
6
81
Sounds like you got this resolved, but just to clarify on the pre-environment:

If you run "sysprep" with the "/generalize" switch, it will cause windows to release its current hardware configuration and re-run hardware discovery as if it was the first time windows was installed. During this process, you must shut down your computer. Afterward, if you boot up windows again, it will run hardware discovery and effectively "undo" the hardware generalization you just performed.

In order to capture an image of windows that will run hardware discovery the first time it boots, you will have to boot into what's called a "pre-environment" to access your hard drive and take an image. Pre-Environments come in all shapes and sizes, but in this case it would make the most sense to use "Windows PE" to take an image with ImageX.

Once you have a copy of your backup image, you can start windows again, it will run hardware discovery and you'll be back to normal.

When you burn a recovery cd, that cd includes a copy of "Windows PE" along with your image and an interface to run a restore job. When you boot to the recovery cd, you're actually booting into "Windows PE" which in turn gives you a nice GUI to run the restore job from the image file.

Fancy, but not necessary for you ;)
 

boing

Senior member
Sep 13, 2001
361
6
81
I understand, thanks for the explanation, I didn't bother with a recovery CD as I have the installation disk so I presume the Windows PE can be accessed through that too. very useful to know as at some point I will be upgrading, that could make the process a doddle!