clone win7
If you want to clone or migrate or deploy your win7-installation you’ll find myriads of complex howtos online. Many of them involve AIK or WINPE which is far to complex for me. I guess I dont need it !!
I use the following tools:
- sysprep.exe - coming with win7 and is on c:\windows\system32\sysprep
- clonezilla - a free available clone-software that can be downloaded as livecopy and support usb, cloning via net, images and partitioncloning.
BIG WARNING !!
As many comments in the internet indicate: I was not the only one that ran into this problem. Some programs (especially Antivirus-programs) are not working with sysprep. After running sysprep you will find yourself in an endless boot-loop with the following error:
Windows could not finish configuring the system. To attempt to resume configuration, restart the computer.
or - if german version -
Die Konfiguration des Systems konnte nicht abgeschlossen werden. Starten sie den Computer neu, um die Konfiguration fortzusetzen.
Usually you could solve such a problem by invoking command-line (Shift-F10) when you see the error and try to disable the affected service with a command like sc config sptd start= boot but for this you have to know the evil service, the servicename and .... this wont work for smart programs like kaspersky (servicename is avp) cause this programs are protecting themselfes from changes. (its called selfdefence).
So : BEFORE RUNNING SYSPREP be sure to deactivate this evil program. In Kaspersky its called selfdefence and its done like as described at http://support.kaspersky.com/faq/?qid=208282021. Of course you have to activate it again after cloning is complete.
Other services reported to cause such problems are “Windows Media Player Netzwerkfreigabedienst”
The Procedure : Step1 - sysprep
- install your win7 and install all drivers and software you want. Your office-tools, your scanner-tools, your image-tools ...
- install all windows-updates and do all the reboots it needs to finally have your windows up2date.
- deactivate Kaspersky-selfdefence or whatever not-Microsoft-protection you have.
- open a terminal-windows and run the following:
cd \windows\system32\sysprep sysprep.exe /oobe /generalize
- this will take a while and windows will shutdown then
The Procedure : Step2 - cloning
Variant 1 : direct cloning harddisk to harddisk (local or via network)
add the harddisk you want to clone too to your computer (via sata, ide or USB) and boot clonezilla-livecd and do the cloning. Alternately you can do cloning via net. Fire up clonezilla on source-computer and select “local to remote” and find that clonezille gives you exact instructions which command you need to run on the target-computer. Then run clonezilla on the target-computer and go to command-prompt and do as told. This will be something like:
- sudo bash
- ocs-live-netcfg
- ocs-onthefly -s SOURCEIP -t DEVICE
The decive should be sda in many cases and if you choose expert-mode in the first place you’ll find loads of useful flags and you’ll find that the default-settings are choosen in a very wise way :)
the network-cloning will finish but not terminate. It will say “100%” but go on doing nothing. Finish with ctrl-c and ignore the “not finished”-warning. Be sure not to press reset, but follow the poweroff-commands to make sure that your disks are synced and everything is written to the harddisk.
Variant 2 : working with images (local and net)
you can also clone to and from images. clonezilla supports usb, smbs, nfs, ssh and much more. pick your choice.
As there is no filemanager name and paths are of uttermost importance of success. When cloning to an image its easy cause you will see where clonezilla put its files. When reading from the images its important to know two things:
- you have to point clonezilla not into the directory where you images-files are, but in its parent-directory. You will then be able to pick your directory. That means: if your data is in /opt/backup/2010-09-12-clonezilla/ then you point clonezilla to /opt/backup or it will complain that it didnt find anything
- clonezilla will mount whatever you tell it to /home/partimag and will unmount whenever you will enter or leave the clonzilla-dialog. So if you need your own hands be sure to do it in the shell-dialog that is inside mozilla (where you can choose between usb, ssh, nfs ... you can also choose shell :) )
after the cloning
well - you just start into windows now. This applies to the original machine as well as the target-machine. (of course you can clone additional copies from the source-machine. If using network-clone you can clone more than one machine at the same time I guess)
Then you start windows and it will take a while and do a lot of device-installations and ask you some basic-questions. Also you have to add an additional user (it will have admin-rights) and windows will start into the new profile for this user. You can use this user or - as I do it - logout immediately and logon using the username you created when installing the original machine and delete the additional user. This has the advantage that the original profile with all the settings can be used by you again.
Note that Kaspersky needs a repair after sysprep. Whyever - I dont know. Just go to software in controlcenter and repair the installation. I think its nevertheless easier to install kaspersky before running sysprep and deactivating selfdefence and then repair it than not installing and installing it on each cloned machine.
Now you can activate your antivirus-stuff again and you are ready to work or join a domain.



