網頁

2010年5月23日 星期日

Another system backup method --- Clone physical disk or partition to VHD

 If you just only one machine as NB or PC, whether you will worry the system suddenly crash or cannot boot normal. If it did happen, maybe you need to try to restore system backup or repair system if never do anything backup job. but the related procedure will spend the long time and never promise the system did can be back to normal status.

In windows 7, it has new function as Boot to VHD. Its mean that we can install new windows 7 system on Microsoft Virtual Hard Disk(just file, not physical disk) next to boot to virtual hard disk. It is very magic for us so that we can do this for testing anything. So do that we don't fear if system crash due to install bad application or security update.

When I follow the related step by step document come from Internet and the final result can create fresh operating system. But it is not convenient for me to install the duplicated application again --- one is on physical disk, the other is on virtual file.
Whether has any smart method to clone physical OS?  Converter!  It hear maybe is good idea. But how to do it? Maybe we can use Microsoft tool --- "Disk2VHD".

Although the whole process suffer some trouble,the result "Clone Physical or Partition to Virtual Disk and boot to Virtual Disk" still finish. I will summary the related process is as following:

1. Convert physical disk or primary partition to virtual disk file by Microsoft "Disk2VHD" tool

2. Attach virtual file(VHD) by Disk Management and Active it

3. Create New VHD by Disk Management and the space need to larger than Converted VHD

4. Use free partition tool to copy Converted VHD's partition to New VHD

5. Add new boot entry for New VHD by EasyBCD 2.0 or above

6. Boot to VHD disk for changing some registry values

   (1).Change related installation directory
  • Navigate the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
  • Double-Click the value named “CommonFilesDir” and change the default value “C:\Program Files” to "%SystemDrive%\Program Files\Common Files"
  • Double-Click the value named “ProgramFilesDir” and change the default value “C:\Program Files” to "%SystemDrive%\Program Files"
  (2)Correct the Drive Name of User Account Security Identifiers (SID)
  • Click the registry key HKEY_LOCAL_MACHINE \ SOFTWARE\ Microsoft\ Windows NT \ CurrentVersion \ ProfileList 
  • Confirm the Key Value of each Key Name exist %SystemDrive%  (example: Key Name= Default map to Key Value=%SystemDrive%\Users\Default )
  • The ProfileList key contain some sub-keys and these express Account SID, so you need to click each sub-key to change ProfileImagePath value replaces "C:" with %SystemDrive%"
Especially, item 6 is very important!
Even though neglect this step, the system still can boot normally. But the system partition file always occupy Drive C (besides virtual disk belong to drive c after boot VHD), never point to Real Drive belong to virtual disk. This behavior will influence the operation and configuration in the future.
How to prove it? please key "set" command on command prompt and you will realize what different thing.

沒有留言:

張貼留言

Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.