Section 6.5. Preventive Maintenance and Data Recovery


6.5. Preventive Maintenance and Data Recovery

Face it: some sort of data loss is inevitable. Whether it's a single lost file or a dead hard diskwhether it's tomorrow or twelve years from nowit will happen. On that happy note, there is plenty you can do about it.

First and foremost, there's no better method of disaster recovery than having a good backup copy of all your data. Any stolen or damaged hardware is easily replaced, but the data stored on your hard disk is not. Unfortunately, hindsight is 20/20, and if you didn't back up, there's not much you can do about it after the fact; even if your computer equipment is insured with Lloyds of London, once your data is gone, it's gone. So, we'll begin our discussion with some preventive maintenance before covering any disaster recovery techniques.

6.5.1. Quick, On-the-Fly Backups

In its simplest form, a backup is a copy of your data. Now, a full system backup, as described later in the next topic, is obviously valuable, but often too involved of a procedure to practice often enough to be entirely effective.

While you might perform a full backup once a week or once a month, you can do a quick backup of your most important files several times a day. No special software or hardware is required, and, best of all, it will only take a few seconds.

The following two solutions are remarkably simple, but the idea is sound, and if you make a habit of making these quick, on-the-fly backups, it will save you hours of work.

6.5.1.1 Solution 1: Simple copy

The next time you've put a few hours into a document, open the folder in Explorer, and make a duplicate of the file by dragging it to another part of the same folder with the right mouse button and selecting Copy Here. See Section 2.2.3 for more information on this function.

Then, if you screw up a file you're working on, if it gets accidentally deleted, or if it gets corrupted by a system crash, you'll have a fresh backup right in the same folder.

6.5.1.2 Solution 2: Simple ZIP

If you've followed the advice in Section 2.2.8, your files will be organized by project rather than application.

At the end of the day (or even several times a day), just right-click the folder of a project on which you've been working, select Send To, and then select Compressed (zipped) Folder. A new .zip file containing compressed versions of all of its contents will appear next to the folder in a few seconds.

If you then need to retreive a file from the backed-up folder, just double-click the new .zip file.

If you've disabled Windows XP's built-in support for ZIP files, and have instead installed a third-party utility, such as WinZip (http://www.winzip.com), the procedure may be slightly different. In the case of WinZip, all you'd have to do is right-click the folder and select Add to foldername.zip.


See Section 2.2.9 for more information on this mechanism.

6.5.2. Back Up Your Entire System

There are more ways to back up your data than to store it in the first place. The sole purpose of a backup is to have a duplicate of every single piece of data on your hard disk that can be easily retrieved in the event of a catastrophe (or even just an accidental deletion). Imagine if your computer were stolen and you had to restore a backup to a brand-new computer. Could you do it? If the answer is no, you're not backed up.

You need to be able to complete a backup easily and often, to store the backup in a safe place, away from the computer, and to retrieve all your data at any time without incident. If it's too difficult or time-consuming, odds are you won't do itso make it easy for yourself.

A bare-minimum backup could be little more than a single CD or floppy diskette with your last three or four important documents on it. It's better than nothing, and it does protect your most recent work, but what about your email, your web browser bookmarks, and the documents you wrote six years ago?

I know what you're thinking, because I've heard it a thousand times: nothing on my computer is really that important, so it's really not worth the time to back up. Okay, assume that's truehow long would it take you to reinstall Windows and all your applications, install all your drivers, reconfigure all your hardware, and customize all your toolbars? If you have a full backup of your system, the answer is not only "not long," but "no problemo" as well.

Ideally, you should be able to back up your entire hard disk on a single piece of media. We won't even entertain the idea of floppies, so think about investing in a dedicated backup solution. The hardware you use should be fully supported by Windows XP, and the backup media (tapes, cartridges, or disks) should be cheap, reliable, and readily available, and you should be able to use them over and over again.

The backup solution that is appropriate for you depends on your work habits and your available funds. Tape drives, optical drives, removable cartridges, and recordable CDs are all getting cheaper, and manufacturers are competing for your business.

While removable cartridge drives (Iomega Zip drives, recordable or rewritable CDs, and even recordable DVDs) are great for quickly archiving data (long-term storage of important documents or projects), they still aren't as appropriate as tape drives for repeatedly backing up entire systems and restoring them in the event of a disaster. Removable drives and CDs use random access, meaning that you can simply open Explorer and read or write to any file on the media immediately. This may be convenient in the short run, but this convenience comes at a price: the media used for these types of backups can be quite expensive (per megabyte) and, more importantly, the backup procedures for random-access drives can be more labor-intensive than for tape drives.

Tape backup drives are still the most cost-effective, reliable, and convenient method for backing up and recovering your system after a disaster. The most obvious caveat is that tape drives use sequential access, rather than random access, meaning that they require special backup software and tend to be slower than comparably priced removables, especially when used for restoring single files. However, remember their key advantage: you can easily and painlessly duplicate the contents of your entire system on one piece of removable media and restore some or all of that data just as easily.

Although tape backup software may seem awkward on the surface, it's designed to allow you to perform a backup in a single step and without user intervention. Good backup software will also make restoring easy; the best programs keep catalogs of your backups, allowing you to find a single, previously backed-up file and get it back quickly and painlessly.

Now, many manufacturers of the various competing products and technologies market their products as backup devices, which isn't necessarily accurate. Basically, you need to find the system that works best for you and fits in your budget. Do some research before investing in any one technology, and make sure it truly suits your needs for a backup device.

Try this: add the cost of the drive you're considering with the media required to store the entire contents of your hard drive twice, and compare it with other solutions. Table 6-2 shows six example technologies and the estimated costs associated with each, at the time of this writing, to back up a 30 GB hard drive. These show that initial bargains are rarely good deals.

Table 6-2. A comparison of the actual costs associated with different types of backup hardware

Technology

Cost of drive

Cost of single cartridge

Capacity of single cartridge

Cartridges per 30 GB backup

Cost of drive and media for two backups

Rewritable CD drive

$100

30 cents

700 MB

43 = $13

$126

Removable Hard Disk

$250

n/a

200 GB

n/a

$250

Recordable DVD drive

$300

$1

4.7 GB

7 = $7

$314

AIT tape drive

$325

$40

70 GB

1 = $40

$405

DDS4 (4mm) tape drive

$400

$15

40 GB

1= $15

$430

Zip drive (750)

$80

$10

750 MB

41 = $410

$900

Floppies

n/a

$0.20

1.4 MB

21,429 = $4,286

$8,572


Naturally, the prices and capabilities of the various technologies will change as quickly as the weather, but the methodology is always the same. Aside from the price, the most important figure to look at is the "Cartridges per 30GB backup"; if it's more than one, it means you're going to have to sit and swap cartridges during each backup. If it's that difficult, odds are you'll never do it.

Do your research, and it will save you time and money in the long run, not to mention that extra peace of mind.

6.5.3. Installing Microsoft Backup

Some sort of backup software has been included with every version of Windows since Windows 3.1 more than a decade ago.

Microsoft Backup (ntbackup.exe), a scaled-down version of the now-defunct, yet excellent Backup Exec Desktop by Veritas (http://www.veritas.com), is installed by default in Windows XP Professional edition, but not in Windows XP Home edition. The implication that backing up is a feature required only by "professional" users and network administrators is one of the reasons nobody backs up their data.

Backup is not available in Control Panel

  1. Insert your Windows XP installation CD, and close the annoying welcome screen that appears if you haven't disabled CD AutoPlay, as described in Chapter 4.

  2. Open Explorer and navigate to \valueadd\msft\ntbackup.

  3. Double-click the Ntbackup.msi file to install the software (or right-click the file and select Install).

  4. When installation is complete, a new Backup entry will appear in your Start Menu, in All Programs Start When Backup first starts, you'll get the cumbersome Backup Wizard. To get out of the wizard and use the more straightforward main window, turn off the Always start in wizard mode option, and then click Cancel. Then, start Backup again, and choose the Backup tab to get started.

    Although this is a good program, it does lack some of the capabilities of the full-featured software, such as a catalog of all backed-up files, a dedicated scheduler, and support for additional hardware. Catalogs, for example, keep track of all your backups, allowing you to choose a single file to be restored and have the software tell you which tape to insert.

    Microsoft Backup supports backing up to a hard disk, floppy, or tape drive, but it can't back up to CD, despite Windows XP's built-in support for CD writers. To get around this, select File from the Backup Destination listbox, and Backup will store your data in a file on your hard disk. Then, use your CD or DVD writer software to burn the single file to disc.


    Because most backup devices come with some sort of dedicated backup software, you may never need Microsoft Backup. Since most backup software is pretty awful, however, you should try all the alternatives available to you before committing to a single solution.

    6.5.4. Tips for a Better Backup

    The following tips should help ensure you will never be without adequate data protection, whether you've already invested in a backup solution or not.


    Keep it simple

    The problem with backups is that most people don't do them. A few minutes every couple of weeks is all it takes, and it can save many, many hours in the long run. A good time to do a backup is just before lunch, just before you go home (if the computer is at work), or just before you go to bed (if the computer is at home). You can also schedule your backup to occur automatically and repeatedly at any time, although you'll need to leave your computer on for that to work.


    Do it after-hours

    Don't do a backup while you're working on the computer. Your backup program will not be able to reliably back up any files that are in use, and your system will be slower and more likely to crash if you are doing too many things at once.


    Use at least two cartridges

    Maintain at least two sets of backups, alternating media each time you back up. If you back up to tape, for example, use the tape "A" for the first backup, tape "B" for the second backup, and then use tape "A" again. That way, if one of the tapes develops a problem or your backup is interrupted, you'll still have an intact, fairly recent backup.


    Name your tapes correctly

    Most backup programs allow you to specify a name for the media the first time you use them (or whenever you initialize the media), which allows the cataloging feature to tell you on which cartridge a certain file resides.

    Make sure each of your tapes or cartridges has a unique name that matches the tape's handwritten label, which will ensure that your software identifies each tape the same way you do. Call your tapes something like "Backup A" and "Backup B," or "Kearney," "Jimbo," and "Nelson." But don't use dates, and don't use the same name for two different cartridges.



    Keep your cartridges off-site

    Your backups should not be kept near your computer, and especially not inside the computer. If your computer is stolen or if there's a fire, your backups would go with it. Keeping one of the backups (see alternating backups earlier in this list) somewhere off-premises is a really good idea.[8] And if you make your living off a computer, you might consider keeping a backup in a safe deposit box.

    [8] Some people keep an extra backup cartridge in their car, which can be handy if you want to keep it off premises, yet still accessible if you need it in a pinch. This is fine, as long as you don't park in the sun, and as long as you don't care if you car gets stolen (from a data privacy point of view).


    Lock 'em up

    Remember that your tape will typically contain a copy of every file on your system, including sensitive data. Even if you protect your data with passwords and encryption (see Chapter 8), anyone could have access to your data if you leave a backup tape sitting right in the drive or in a nearby unlocked drawer. While you're at it, you may wish to employ your backup software's security features, such as password-protecting your backups.


    Back up the System State

    Most backup utilities designed especially for Windows XP give you the option of backing up your "System State," which is essentially a euphemism for the files that make up your Registry (see Chapter 3). You should always take advantage of this feature; without a valid Registry backup, all those backed-up applications won't do you any good.


    Forget floppies

    Don't back up to floppies if you can avoid it. Floppies are much more likely to fail than your hard disk, although it's marginally better than no backup at all. Floppies should only be used to transfer information from one computer to another, and then only if there's no network connection between them and you don't have a CD writer.


    Back up your backup software

    Make sure you have a copy of your backup software handy at all times. If you can't install your backup software, you won't be able to access your backups.


    Automate your backups

    Configure your system for unattended backups. Ideally, you should only have to insert a single cartridge and click "Go" to complete a backup. Don't put up with lower-capacity backup devices that require you to swap cartridges in order to do a single backup. Additionally, most backup software has options to bypass any confirmation screens; by taking advantage of them, you eliminate the possibility of starting a backup before you go home and coming to work the next day only to see the message, "Overwrite the data on tape?"


    Don't bother with incremental backups

    Most backup software allows you to do a full-system backup and then supplement it with incremental backups that only store the files that have changed since the last backup. This may mean that you can do some backups in less time, but it also means that you'll have to restore each of those backups when recovering from a disasterone full backup and ten incremental backups adds up to eleven restores. More importantly, incremental backups require that the original full backup be intact. If something happens to that one backup, all subsequent incremental backups will be rendered completely useless.


    Prepare for the worst

    Throughout this book, you'll find tips to help you prepare for a catastrophe, such as a hard disk crash or virus attack. For example, Chapter 10 explains how to repair a Windows installation and even create a boot diskette so you can start Windows even if something goes wrong. If you take the time to prepare for these problems now, rather than after they happen, you won't have to say "I should've . . . "


    Test your system

    Don't wait until it's too late to find that the restore process doesn't work or requires a step you hadn't considered. Just do a simple trial backup of a single folder or group of files. Then, try to restore the backup to a different drive or folder. Only after you've successfully and completely retrieved a backup can you truly consider your data safe.

    6.5.5. Recovering Your System After a Crash

    The purpose of backing up is to give you the opportunity to restore your system to its original state if something unforeseen should happen to your hard disk, whether it be theft, fire, malfunction, or just user error. You'd be surprised at how many people back up their system without having any idea how to restore it later should the need arise. The backup doesn't do you any good if you can't get at your files later, so it's important to take steps to make sure you can restore your system from scratch if necessary.

    The most important consideration is that the software you use to restore your files be the same one you used to back them up. This means installing Windows and then installing your backup software before you can even begin the restoration process.

    Now, reinstalling Windows doesn't necessarily mean that you lose your Windows preferences and must reinstall all your applications. All you need to do is to reinstall Windows (as well as the software and drivers for your backup device, if necessary) to a state sufficient only to run your backup software. You'll also want to install this temporary version of Windows in a different folder name than what was used previously. See Chapter 1 for issues concerning installing and repairing Windows, as well as setting up a dual-boot system for the purposes of this solution. You may also need the Windows Recovery Console, discussed at the end of this chapter, to help recover a broken system.

    6.5.6. Protecting Your Hardware

    Although this section focuses mostly on backups, you shouldn't neglect your hardware. All hardware is sensitive to heat, light, dust, and shock. Don't block any vents on your computer or your monitor, and routinely vacuum all around to remove dust (too much dust can cause your components to overheat and your disk drives to fail).

    For desktop computers, make sure you have at least one functioning fan in your computer's power supply (preferably two), one mounted directly on top of your processor and one mounted on the main chip on your video card; an additional fan in front won't hurt, either. If you can't hear your computer, odds are it isn't being adequately cooled. Make sure that air can flow freely inside from the front of the computer to the back; look for a mass of cables blocking the passage of air. Overheated components can cause system crashes, slow performance, and data loss.

    If your computer and every external peripheral are connected to a surge protector, the possibility of damage by an electrical surge is virtually eliminated. Many surge protectors also allow you to run your phone cables through them, protecting them from phone line surges that can damage your modem. And if you live in an area susceptible to blackouts or brownouts, you might consider an uninterruptible power supply (UPS), which will eliminate the problem of lost data due to lost power. (Naturally, your battery-powered laptop has a UPS built in.)

    Make sure all your cables are tied neatly behind the computer so pins and plugs don't get broken and plugs don't become loose; pets love to chew on cables, pulling them out and otherwise mangling them. And tighten all those cable thumbscrews.

    Keep floppies, tapes, and other magnetic cartridges away from your monitor and speakers; they're just big magnets that can turn disks into coasters in no time. And sit up straightno slouching!

    6.5.7. Create a Boot Disk

    Long gone are the days when an entire operating system can be fit on a single floppy diskette. Actually, many would argue that the floppy drive is essentially obsolete, with no real purpose in a modern computer, at least as long as there a network connection or CD writer is available to transfer files. However, from time to time, a floppy can still prove useful.

    In some earlier versions of Windows (e.g., Windows 9x/Me), there was a built-in feature for making a bootable floppy, but it only installed a few files on a blank disk that essentially allowed you to boot into DOS and then start or repair the Windows installation on your hard disk. Being able to boot off a floppy also meant that you could access your files if Windows wouldn't start at all.

    Now, if you have a bootable floppy made on a Windows 9x/Me system, you can use it to boot any modern system, even if it is running Windows XP. However, if your hard disk uses the NTFS filesystem (discussed in Chapter 5), you won't be able to access your hard drive from the DOS floppy (since NTFS isn't supported in those versions of Windows). And even if you're still using the FAT32 filesystem, which will be readable from a Windows 9x/Me boot disk, you won't be able to start Windows XP or effect any substantial repairs from such a floppy.

    Essentially, if you've become accustomed to being able to boot to DOS in earlier versions of Windows, you'll have to adjust your strategy, but that doesn't mean you'll have to live without any safety net at all. There are several ways in Windows XP to fill the holes left by the absence of DOS:


    Running old programs

    One reason to use a boot disk in the early days was to run old DOS software that refused to operate from within Windows. Although this is no longer practical in Windows XP, you can run any such software in "compatibility mode" (discussed earlier in this chapter). Another way to access old software that won't run in Windows XP is to set up a dual-boot system, discussed in Chapter 1.


    Repairing Windows

    The best way to repair a Windows installation that won't start is to use the Windows Recovery Console, covered later in this chapter.


    Installing Windows

    Since Windows XP comes on a bootable CD (see Chapter 1), you don't need a floppy to install it.


    Accessing files

    If you can't start Windows, and attempts to repair it have failed, you'll still need to access your personal files. Installing Windows XP in a second directory is probably your best bet here. See "Setting up a dual-boot system" in Chapter 1 for instructions.

    Now that I've effectively talked you out of creating a bootable floppy in Windows XP, I'll show you two ways to do it.

    6.5.7.1 Make a Windows XP boot disk

    Follow these steps to make a boot diskette that will load the copy of Windows XP on your hard disk. Use this when your hard disk won't boot by itself, but Windows appears to be undamaged. Use the Windows Recovery Console (see the next section) to repair the problem.

    1. Obtain a blank diskette, and insert it into your floppy drive. Floppies can typically be found behind file cabinets, under coffee cups, and at the bottom of "junk" drawers.

    2. If you haven't done so already, you'll need to configure Explorer to show your hidden and system files. Go to Control Panel Folder Options View tab, and select Show hidden files and folders. Next, turn off the Hide protected operating system files option, and click OK when you're done.

    3. Open Windows Explorer, and navigate to the root directory of your boot drive (usually C:\).

    4. Copy the following three files from this folder to your floppy (usually A:\): ntdetect.com, ntldr, and boot.ini.[9]

      [9] See "Setting up a dual-boot system" in Chapter 1 for details on the boot.ini file.

    5. Close Explorer and eject the floppy when you're done.

    This bootable floppy won't get you to a command prompt, as you might expect. If you need access to a non-Windows command prompt, you have two options: use the Windows Recovery Console (see the next section), or create a Windows 9x boot disk.

    6.5.7.2 Make a DOS boot disk

    Here's how to make a diskette from within Windows XP that will boot you into DOS, just like the old days:

    1. Insert a diskette into your floppy drive.

    2. Open Windows Explorer, right-click your floppy drive icon, and select Format.

    3. Turn on the Create an MS-DOS startup disk option and click Start.

    4. Wait.

    When you're done, you'll have a disk that will boot into the last version of MS-DOS ever released by Microsoft: Windows Millenium (also known as Windows Me).

    This can be really handy if you're trying to resurrect an older computer running Windows 9x/Me, but it will be of minimal use in Windows XP. Even if you were to boot a Windows XP system with this disk, you most likely wouldn't be able to see any of its drives, because Windows Me isn't compatible with NTFS volumes. See "Choosing the Right Filesystem" in Chapter 5 for more information.

    If you need another specific version of DOS (e.g., Windows 98 Second Edition, Windows 95, MS-DOS 3.3), go to http://www.bootdisk.com/ and download the specific disk image you need.


    6.5.8. Using the Windows Recovery Console

    The Windows Recovery Console (WRC) is a tool included with Windows XP, used to repair the operating system when it won't start, as well as perform some other tasks not otherwise possible from within Windows.

    For those accustomed to being able to boot into DOS to effect repairs in some earlier versions of Windows, the WRC is the Windows XP equivalent; see Section 6.5.7, earlier in this chapter, for more information.


    The Windows Recovery Console allows you to do the following:

    • Repair certain parts of a Windows XP installation, including the filesystem boot sector, the Master Boot Record (MBR), and the Boot Manager configuration

    • Copy, rename, delete, or replace operating system files or any "in-use" files for that matter that otherwise can't be modified while Windows is running.

    • Enable or disable services or devices for the next time Windows is started.

    • Create and format hard drive partitions (discussed in Chapter 5).

    The whole point of the Windows Recovery Console is that it can be started when Windows isn't running. To get into the WRC, start by booting up off the Windows CD, as described in "Installing Windows XP" in Chapter 1. After Setup loads all of its drivers, press R to start the Windows Recovery Console.

    Recovery Console as a Boot Option

    You can install the Recovery Console on your hard disk so that you can get to it without having to boot off the CD. Given how useful the WRC can be in a jam, you may want to do this now as a preventative measure, especially if you're unable to reliably boot from a CD. And if you use the Recovery Console frequently, you'll be able to start it more quickly if it's installed on your hard disk.

    To install the WRC, go to Start where d: is the drive letter of your CD drive. This adds the Recovery Console to your Boot Manager menu (see "Setting up a dual-boot system" in Chapter 1), giving you the option to start it every time your computer boots.


    For security purposes, the Recovery Console has been intentionally hobbled to prevent access to most of the folders on your hard disk. Before you find yourself in the inevitible position of not being able to get into Windows, you should take this opportunity to lift these restrictions. Start the Local Security Settings editor (secpol.msc), and navigate to \Security Settings\Local Policies\Security Options in the tree. Double-click the Recovery Console: Allow floppy copy and access to all drives and all folders entry, click Enabled, and then click Ok.


    Regardless of how the WRC is started, you'll be greeted with the following friendly welcome message:

    Windows NT(TM) Boot Console Command Interpreter. WARNING: This is a limited function command prompt intended only as a system recovery utility for advanced users. Using this utility incorrectly can cause serious system-wide problems that may require you to reinstall Windows to correct them. Type 'exit' to leave the command prompt and reboot the system. 1: C:\WINDOWS 2: D:\WINDOWS 3: E:\WINNT Which Windows installation would you like to logon to (enter to abort)?

    Naturally, the operating systems installed on your system (and thus the options available to you) may be different. In most cases, choose 1 here; if you have more than one Windows installation, choose the one you wish to repair, and log in using your Administrator password.

    If you've forgotten your Administrator password (set when Windows XP was installed), WRC won't let you in. You'll have three tries before WRC reboots your system. If this is the case, and Windows won't start, your best bet is to try one of the other repair options described in "Reinstalling Windows XP" in Chapter 1.


    Once you've logged in, the WRC looks and feels like the Windows XP Command Prompt (see Chapter 10). However, it's important to realize that it's not exactly the same: for example, you can execute some of the standard DOS commands (albeit in a more limited fashion), but you won't be able to launch DOS or Windows programs.

    6.5.8.1 Windows Recovery Console commands

    The following DOS commands, documented in Chapter 10, can be used in the Windows Recovery Console: attrib, cd, cls, copy, del, dir, exit, md, more, ren, rd, set, and type. In addition, you'll be able to use the chkdsk utility discussed earlier in this chapter, the DiskPart utility discussed in "Working with Partitions," earlier in this chapter, as well as the expand, format, and net utilities.[10]

    [10] These commands are documented in detail in Windows XP in a Nutshell (O'Reilly).

    The following special commands are available in the Windows Recovery Console:


    batch filename [ outputfile]

    Executes a batch file, where filename is the name of the batch file to run, and outputfile is the name of an optional file into which the output from the job is stored. Note that you can't execute batch files simply by typing the filename, as you can in the real Command Prompt; see the discussion of batch files in Chapter 10.


    bootcfg / command

    Starts the Boot Manager configuration and recovery tool. This tool is used to view, edit, and rebuild the boot.ini file, discussed in "Setting up a Dual-Boot System" in Chapter 1. The command can be any of the following:


    add

    Adds a new entry to the boot.ini file.


    copy

    Creates a backup of the boot.ini configuration file.


    default

    Sets the default boot entry.


    disableredirect

    Disables redirection instigated by the redirect command.


    list

    Displays the entries currently specified in boot.ini.


    rebuild

    Lists all of the Windows installations and rebuilds the boot menu by selectively adding entries. Note that it's a good idea to use bootcfg /copy to create a backup of boot.ini before using rebuild.


    redirect [ port baudrate | useBiosSettings]

    Enables redirection of the boot loader output to the specified serial port, using the specified baudrate. Alternately, specify bootcfg /redirect useBiosSettings to use the default COM port settings in the system BIOS (see Appendix B).


    scan

    Scans your hard disk for all Windows installations and displays a list of the results. This list is not dependent on the contents of the boot.ini file, but rather on the actual operating systems found on the system. The rebuild command incorporates the scan function.


    disable [ service | device_driver]

    Disables a system service or a device driver for the next time Windows starts. See enable, next, for details.


    enable service | device_driver [ startup_type]

    Starts or enables a system service or a device driver for the next time Windows starts. Use the listsvc command to list the names of all available services and device drivers. The startup_type option can be SERVICE_BOOT_START, SERVICE_SYSTEM_START, SERVICE_AUTO_START, or SERVICE_DEMAND_START.


    fixboot [ drive]

    Writes a new partition boot sector onto the specified partition, where drive is the drive letter. In most cases, you can omit drive to use the current partition. Use this command to fix the partition boot sector if it has been damaged, typically by a virus or the installation of another operating system.


    fixmbr [ device]

    Repairs the master boot record of the specified disk. Use the map command to display the entries for device. In most cases, you can omit device to use the default boot device, upon which your primary operating system is installed. Use this if the boot record has been damaged, typically by a virus or the installation of another operating system. See "Creating a Dual-Boot System" for a practical example of this command.


    listsvc

    Lists the services and drivers available on the computer, for use with the enable and disable commands.


    logon

    Logs on to another Windows XP/2000 installation (assuming you have more than one) without having to reboot and re-enter the Recovery Console. Naturally, you'll need the administrator password for any such installation.


    map

    Displays the drive-letter mappings for use with the fixmbr command.


    systemroot

    Changes the current directory (like the cd command explained in Chapter 10) to the "systemroot" directory of the operating system to which you are currently logged on (usually c:\windows).

    6.5.8.2 Lifting Recovery Console restrictions

    By default, the attrib, copy, del, dir, and ren commands don't support wildcards (* and ?) when used in the Windows Recovery Console. While this is a safety feature intended to prevent unintentional damage to the system, it can be frustrating (to say the least) when you actually need to get something done. To lift this restriction, type:

    set AllowWildcards = true

    Make sure to include spaces before and after the equals sign whenever using the set command (e.g., "AllowWildcards = true" instead of "AllowWildcards=true"); otherwise, you'll get an error as well as a little insight into precisely how dense some Microsoft developers can be.


    Another restriction is one placed on the cd command, where WRC will only allow you to change to certain directories. To fix this, type:

    set AllowAllPaths = true

    To enable access to the floppy drive, type:

    set AllowRemovableMedia = true

    Finally, to turn off the prompt that appears when you try to replace a file with the copy command, type

    set NoCopyPrompt = true

    Unfortunately, these are only temporary settings and are lost as soon as the system is restarted. For more information, see the set command in Chapter 10.

    If you haven't already enabled the Allow floppy copy and access to all drives and all folders option from within Windows (as described in the beginning of this section), you may encounter a "Set command is currently disabled" error. This, unfortunately, can only be fixed by returning to Windows, thus becoming somewhat of a Catch-22 if your computer currently won't boot. Probably the best solution is to install a second copy of Windows XP into a different directory (see Chapter 1 ), and effect your repairs from there.




    Windows XP Annoyances For Geeks
    Fixing Windows XP Annoyances
    ISBN: 0596100531
    EAN: 2147483647
    Year: 2003
    Pages: 97
    Authors: David A. Karp

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net