Monday, January 30, 2012

Replace old disk with new

I by chance ran the online diagnostics from dell.com on my Dell 6410 lattitude. It told me to replace my hard disk. The disk was under warrenty and when I called the Dell rep in Israel they agreed that I need to replace my disk. Not wanting to reinstall everything from the beginning I started looking at imaging software. In retrospect I would have saved the company much more money and time had I bought a copy of ghost straight out and made an image. But instead I did it the hard way and created a windows PE disk and used imageX. Here are my trials and tribulations.
First I dowloaded the windows AIK from microsoft. They have some nice step by step guides but of course - like the cook who leaves out one ingredient from the recepe, I needed to tweak the instructions.

My first task was to create a bootable winPE CD rom: Here are the steps I took. Its copied from the instructions with my corrections. (the instructions used "-" and only "/" works.)

After installing the Windows AIK right lick Deplyoment Tools Command promprt and select Run AS Aministrator.
AT the command prompt
1.--> copype.cmd x86 c:\winpe_1
2. copy c:\winpe\winpe.wim c:\winpe\ISO\sources\boot.wim
This is the tricky part to add boot support
3. Dism /Mount-Wim /wimfile:c:\winpe\ISO\sources\boot.wim /index:1 /MountDir:C:\win\mount
(pay attention to the lack of spaces after :)
4. copy c:\winpe\ISO\bootmgr c:\winpe\mount
5. mkdir c:\winpe\mount\boot
6. xcopy /c/h/e/r/k/y c:\winpe\ISO\boot c:\winpe\mount\boot\


This adds imagex. You can theoretically add ghost or any other imaging software that will work in a windows 7.
(you should be able to add network drivers also. on my dell there at C:\Drivers\network\R291627
7. copy "C:\program files\Windows AIK\Tools\x86\*.*" c:\winpe\iso\

Configures the BCD Store (whatever that is)
8. Del c:\winpe\mount\boot\BCD
9. BCdedit /createstore c:\winpe\mount\boot\BCD
10. Bcdedit /store c:\winpe\mount\boot\BCD /create {bootmgr} /d "Boot Manager"
11. Bcdedit /store c:\winpe\mount\boot\BCD /set {bootmgr} device boot
12. Bcdedit /store c:\winpe\mount\boot\BCD /create /d "WinPE" /application osloader

The last command generates a value which should be copied in the dos prompt (right click -->Edit --> Mark--> Enter (Include the "<>" at the beginning and end respectively and copy instead of in next commands
13. Bcdedit /store c:\winpe\mount\boot\BCD /set osdevice boot
14. Bcdedit /store c:\winpe\mount\boot\BCD /set device boot
15. Bcdedit /store c:\winpe\mount\boot\BCD /set path \windows\system32\winload.exe
16. Bcdedit /store c:\winpe\mount\boot\BCD /set systemroot \windows
17. Bcdedit /store c:\winpe\mount\boot\BCD /set winpe yes
18. Bcdedit /store c:\winpe\mount\boot\BCD /displayorder /addlast

Create the CDRom
19. oscdimg -n -m -o -bc:\winpe\etfsboot.com c:\winpe\mount c:\winpe\winpe.iso
20. Burn the iso file to a cd rom using your burning software

IMPORTANT STEP IN DELL. In order to boot with the cd rom I created I needed to go to the bios and --> system configuation --> SATA --> device setup (not sure what its called) --> select ATA (by default its on raid). Then reboot press f12 select boot from CD rom and press enter a few times so it catches.

I didn't copy the network drivers my CD rom but the winpe gave support for the usb drive and I copied the network drivers to the USB Drive (F: in my case) and loaded them into windows pe

21. drvload \F:\NetDrvr\E1c6232.INF
Then I logged onto the network share where I wanted to save the image
22. NET use N:\\backupPC\myshare /U:myname
23. enter password
now i could make an image to the share.

24. ImageX /capture c: n:\cdiskimg.wim\ "C-Disk Backup" /norpfix /check /verify

This was successful.

I then replaced the old disk with the new disk. booted the computer again from my winpe cd rom and added the network drivers.
I partitioned and formated the new disk:
DISKPART
Sel disk 0
clean
Create partition primary
assign drive letter =c:
active
exit
format c: /q/y

Now I can apply the image to the new disk:
imagex /apply n:\cdiskimg.wim 1 c:\

Now the tricky part was to edit the BCD of the image so the computer would boot from it. I was not successful in doing so. what worked was

First - boot to the bios and return the disk operation to "RAID"
Boot from a Windows installation disk
Choose a language and select repair windows installation
Choose startup repair.
Windows will then create a new BCD that works.

after 3 days of work that ghost will do in an hour and a half you are finished.






Labels: