Random thoughts from Jeffrey RSS 2.0
# Wednesday, April 29, 2009

So for some reason you have a Lenovo X200T, a bootable USB hard drive running WinPE (Vista SP1/Server 2008 based), ImageX, and the WIM files that were originally on the recovery partition. For some reason you no longer have the recovery partition (probably because it was deleted to free up space), you don’t have the recovery discs that you burned like a conscientious computer owner, and your X200T wont start the OS (say, because you didn’t think about all the implications of encrypting the entire drive with BitLocker and then not having the recovery key…). Also, just to make it more fun, you’re on a plane!

Obviously the system needs to be restored. And because of the things you do have, you’re in luck! It’s possible! And not that hard! (yeah, right…)

First, backup everything you can off the X200T’s hard drive, because restoring things is destructive and will involve wiping the drive. If you can’t back things up…umm…learn to live with disappointment and loss? Since the system wont start the OS, you’ll probably be doing this from within WinPE. Good luck copying everything with the command line (xcopy can be useful here).

If you aren’t in WinPE yet, adjust the bios settings to allow you to boot off the bootable WinPE USB hard drive. Then boot into WinPE.

The first real part of the recovery process is to wipe the X200T’s drive and repartition it. Start diskpart and issue the following commands:

select disk 0
clean
create partition primary size=1499
active
assign letter=s
format fs=ntfs label="SERVICEV003" quick
create partition primary
assign letter=c
format fs=ntfs label="SW_Preload" quick

Next, apply the WIM files to the disk (exact paths to the WIM files will probably be different for you):

imagex /apply E:\images\x200t\sdrivebackup.wim 0 S:\
imagex /apply E:\images\x200t\cdrivebackup.wim 0 C:\

So, in a perfect world, everything would be all set to go now. Unfortunately, you my run into problems with bootmgr not being able to find the OS, or the OS thinking its on a different drive letter than it should be. To fix those issues, a little editing of the boot configuration database will be required:

bcdedit /store S:\boot\bcd /set {9dea862c-5cdd-4e70-acc1-f32b344d4795} device partition=S:

bcdedit /store S:\boot\bcd /set {3657ebe1-d4e6-11dc-88f0-ec9c0d1f1864} device partition=C:
bcdedit /store S:\boot\bcd /set {3657ebe1-d4e6-11dc-88f0-ec9c0d1f1864} osdevice partition=C:

bcdedit /store S:\boot\bcd /set {3657ebe2-d4e6-11dc-88f0-ec9c0d1f1864} device partition=C:

bcdedit /store S:\boot\bcd /set {b2721d73-1db4-4c62-bf78-c548a880142d} device partition=S:

bcdedit /store S:\boot\bcd /set {466f5a88-0af2-4f76-9038-095b170dc21c} device partition=S:

bcdedit /store S:\boot\bcd /set {ae5534e0-a924-466c-b836-758539a3ee3a} device partition=S:

Note: bcdedit is kind of sensitive about the drive letter availability when it’s run. Which is why S: was used back in the diskpart stage.

In an almost perfect world, everything would now be all set to go. Too bad things aren’t even almost perfect. One further step was required to swap get the drive letter assignments correct: the registry of the restored OS needs to have its drive letter mounts tweaked BEFORE the OS boots for the first time. This step is probably the most complicated, since it's not scriptable. Basically, start up regedit. Navigate to the HKLM\SYSTEM\MountedDevices key. Make note of the binary data for the "\DosDevices\C:" and "\DosDevices\S:" values (in my case they were something like "C4 78 A4 9C 00 00 C0 5D 00 00 00 00" & "C4 78 A4 9C 00 00 10 00 00 00 00 00"). Now load System Hive from the restored OS (it's "C:\windows\system32\config\system") in regedit. Navigate to the SYSTEM\MountedDevices key in that hive. Change/create the SAME values with the SAME data that the WinPE registry had.

After rebooting the system (remember to either unplug the USB hard drive or adjust the bios settings so its no longer the preferred boot device), everything should be back to working.

Now playing: Neko Case – Middle Cyclone – 09 Magpie To The Morning

Wednesday, April 29, 2009 04:18:04 UTC  #    Comments [0] -
IT
Comments are closed.
About the author
Jeffrey Stults
Jeffrey Stults is a software developer currently in Portland, Oregon. He is contactable at:
stultsj@ntldr.net
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Jeffrey Stults, Jr.
Statistics
Total Posts: 256
This Year: 0
This Month: 0
This Week: 0
Comments: 23
Utilities
Pick a theme:
Sign In