3. Level 3: Dealing with total system instability
Every now and then, you
will run into major system issues — systems won't start, boot sectors on
drives will be damaged, or Windows will be completely corrupted. When
this happens, you need to rely on Vista's more advanced recovery tools.
That's where the Windows Recovery Environment (WinRE) comes in. WinRE is
a self-contained operating environment based on Windows PE that can be
used to give you access to non-working systems. As such, it includes a
series of different tools that can be relied on to recover these
systems. The tools in WinRE include:
Startup Repair that can automatically repair some problems that prevent Windows from booting up properly.
System Restore, which has been discussed at length.
Windows
Complete PC Restore, which lets you restore a complete PC image.
Windows Memory Diagnostic Tool, which can verify RAM to identify potential problems.
Command Prompt, which then lets you run any commands against the PC and access common tools, such as Regedit.
In addition, WinRE gives you access to the shutdown and restart options for the system.
Working with the Windows Recovery Environment
WinRE is available in two
flavors. The first is off the Windows Installation DVD. When you boot
with this DVD, Windows Setup displays the initial setup screen where you
choose the language and regional options for the installation. Then it
moves you into the Install now screen. At this point in time, you can
click on Repair your computer in the lower left-hand corner of the
screen to access WinRE. After WinRE is launched, it looks for existing
Windows installations on the system disk. At this point, you can load
additional drivers if needed, or simply proceed to the System Recovery
Options screen, shown in Figure 14, by clicking Next.
NOTE
Remember that
you should spend only a certain amount of time on system recovery before
you simply move on to system re-imaging. For example, if your imaging
process only takes 30 minutes and you have implemented the folder
redirection/roaming profile strategy
then it makes little sense to spend 30 minutes or more troubleshooting a
serious system problem. Just re-image the PC and move on. However, if
the problem is recurring, then you will need to spend time identifying
its root cause. In that case, you might want to give the user a
different PC so that they can continue with their work as you identify
the cause of the issue.
When it is installed
on the system, WinRE can sometimes launch without assistance, although
this is certainly a behavior to which you do not want to expose users.
This happens when there is a boot failure. Windows detects the failure
and then launches WinRE to perform automated repairs. But in some cases,
the automated repair mode will not work. This includes:
Partition Table damage or lost boot sectors on a system disk
Missing or damaged Boot Manager (bootmgr.exe)
Missing or damaged Boot Configuration Data
Running Memory Diagnostics
One of the most common
problems users face with PC is corrupt memory modules. When you use a
corrupt memory module, information stored within memory cannot be
retrieved. This often causes Windows to fail because the missing
information destabilizes the OS. For this reason, the WinRE environment
includes a Windows Memory Diagnostics Tool (WMDT). Use WinRE to launch
this tool. When you launch it (see Figure 15),
WMDT will reboot the system and perform a memory scan, identifying
potential bad memory blocks and mark them as such so that the system
does not use them anymore (see Figure 16).
This is a stopgap
measure at best and should be used mostly to identify bad memory blocks.
Replace the bad memory modules as soon as possible.
Using Startup Repair
Startup Repair is
an automated tool that scans unbootable systems and automatically
repairs them. It corrects issues, such as corrupt registry hives,
missing system files and drivers, disk boot sector corruptions, and
other startup issues.
To use it, launch WinRE and
select Startup Repair. This launches a window that automatically scans
the system for boot issues (shown in Figure 17) and then generates a report (shown in Figure 18).
The report is generated whether or not Startup Repair finds issues. If
you choose not to view the report after Startup Repair is run, you can
always view it later. It is located in %WINDIR%\System32\LogFiles\Srt. Startup Repair files are named SrtTrail.txt.
Working with Boot Configuration Data
When these tools do not
resolve the issue, then you can try the more advanced recovery tools
found in Windows Vista. One of these is the Boot Recovery tool (bootrec.exe).
This tool can be used to repair damaged boot records on disks, missing
or corrupt boot sectors, or even corrupt Boot Configuration Data (BCD)
stores. With Windows Vista, Microsoft replaced the traditional Boot.ini file with a new BCD store. This store is now used to tell Vista where OS partitions can be found on a disk.
The Boot Recovery tool
is accessed through WinRE. When in the System Recovery Options screen,
select Command Prompt. Then, once the Command Prompt is launched, type:
bootrec /?
This will display the options for the command. Several options are available. Each is listed in Table 1.
Table 1. Boot Recovery Tool Options
Option | Description |
---|
/FixMBR
| Using
this option writes a new master boot record on the system disk. It does
not overwrite the existing partition table, but sets the disk so that
Vista can start. |
/FixBoot
| Using
this option writes a new boot sector to the system disk. For example,
if you install another OS onto a system where Vista is already
installed, then the Boot Manager (bootmgr.exe) may have been replaced. This option repairs this issue. |
/RebuildBCD
| Using
this option rebuilds the Boot Configuration Data store. During the
rebuild operation, it lets you choose which compatible OS partition to
add to the BCD. |
/ScanOS
| Using
this option scans all disks to locate a Vista installation. Use this
option after you have used the /RebuildBCD option to completely recreate
the BCD store. |
Microsoft also released a BCD store editor: bcdedit.exe. This tool includes a lot of different capabilities, all of which are very useful when you need to repair nonstarting systems. Table 2 outlines the options you can use with bcdedit.exe.
Table 2. Boot Data Configuration Editor Options
Command | Focus | Description |
---|
/createstore
| BCD Store | Creates a new empty BCD store |
/export
| BCD Store | Exports the contents of the BCD store to a file |
/import
| BCD Store | Restores BCD store contents from previously exported data |
/store
| BCD Store | Indicates which BCD store to use |
/copy
| BCD Store Entries | Copies a specific entry in the BCD store |
/create
| BCD Store Entries | Creates a new BCD store entry |
/delete
| BCD Store Entries | Deletes a BCD store entry |
/deletevalue
| BCD Store Entry Settings | Deletes a specific element in an entry |
/set
| BCD Store Entry Settings | Sets a value for an entry |
/enum
| Output Control | Lists entries in a BCD store |
/v
| Output Control | Turns on verbose mode |
bootsequence
| Boot Manager Controls | Used to create a boot configuration order, but only for the next boot process |
/default
| Boot Manager Controls | Specifies the default entry to use when booting |
displayorder
| Boot Manager Controls | Specifies the order in which options are displayed to users |
/timeout
| Boot Manager Controls | Indicates the timeout value for a boot option |
displayorder
| Boot Manager Controls | Specifies the order in which options are displayed in boot management tools |
/bootems
| Emergency Management Services (EMS) | Enables or disables EMS booting for an entry |
/ems
| EMS | Enables or disables EMS booting for a boot entry |
/emssettings
| EMS | Sets global EMS values |
/bootdebug
| Debugging | Enables or disables debugging for an entry |
/dbgsettings
| Debugging | Enables or disables global debugging settings |
/debug
| Debugging | Enables or disables kernel debugging settings |