Project Snapshot
Scheduled backups are an important part of any data recovery scenario. In Windows 2000 and later, the NTBackup utility is integrated with the Removable Storage service and Task Scheduler to simplify media management and automate unattended backups. It's certainly an improvement compared with Windows NT Server 4.0's NTBackup utility, which doesn't have these features.

Although NTBackup, the Removable Storage service, and Task Scheduler are documented separately in the Windows online Help system, the interactions between these tools aren't adequately explained. NTBackup is simple to use interactively, but many people have expressed frustration when trying to get scheduled backups to work consistently. I've seen many small businesses purchase third-party backup software simply because they perceived NTBackup as too confusing and difficult to use. I'll show you how NTBackup, the Removable Storage service, and Task Scheduler work together and how to allocate tapes, create scheduled jobs, and remove failed tapes. Note that my instructions assume one standalone tape drive; the process might be different if you use other types of backup hardware, such as robotic libraries.

Understanding How the Tools Interact
The Removable Storage service (ntmssvc) manages devices that use removable media, including tapes. In removable-storage terms, a library is a device, such as a tape drive, that uses a particular type of media, such as a tape. A media pool is a logical collection of removable media. There are two types of pools: application pools (pools used by a particular application, such as NTBackup) and system pools (pools used by the Removable Storage service). There are three system pools: free, import, and unrecognized. The system pools hold media that aren't currently being used by an application.

You can view the libraries and media pools available to the Removable Storage service by opening the Removable Storage console. (On the Start menu, select Run, ntmsmgr.msc.) When you start NTBackup for the first time, it creates a media pool that matches the type of media used by the tape drive (e.g., the Travan media pool if a tape drive uses Imation's Travan tapes). This media pool will be under the Backup media pool in the console's directory.

When you insert a tape into a tape drive, the Removable Storage service determines whether the tape has been allocated to an application by attempting to read identifier information on the tape. If the tape isn't being used by any applications, the Removable Storage service places the tape into one of the system media pools.

Before creating scheduled backup jobs, it's important to understand that NTBackup requires tapes that have been allocated to it. You can see a tape's allocation by checking the Format column in the Removable Storage console, which Figure 1 shows. (Note that the Format column doesn't appear in the Win2K version of the Removable Storage console.) Alternatively, you can double-click the tape in the Removable Storage console, then click the Side tab. As Figure 2 shows, the Type field in the Identification label section identifies the tape's allocation.

In the Removable Storage console in Figure 1, notice that the Name column lists the tape's name as Friday 1 - 1, yet the Info field on the Side tab in Figure 2 lists the tape's name as Friday 1. Because the Removable Storage service supports media with more than one side, the - 1 after the tape's name refers to the first allocated side. The second allocated side of a writable two-sided medium would be appended with - 2. The Removable Storage service automatically appends the side number, which isn't used except when displaying the tape in the Removable Storage console.

When you start NTBackup, it checks the current tape's allocation information. If NTBackup recognizes that the tape is allocated to an application but the allocation isn't recorded in the Removable Storage database (e.g., because the tape was used on a different computer), NTBackup asks whether you want to move the tape to the NTBackup media pool on this computer. Figure 3 shows the dialog box that you receive in Windows 2003 and Windows XP. Figure 4 shows the dialog box in Win2K. As you can see, the wording differs substantially between the two dialog boxes, which might be confusing if you just migrated from Win2K to Windows 2003. If you want NTBackup to move the tape to its media pool, select the Allow Backup Utility to use all the recognized media check box (Windows 2003 and XP) or the Allocate all compatible import media to Backup check box (Win2K), then click OK. Alternatively, you can control this behavior by adjusting NTBackup's default options. Open NTBackup, select Tools, Options, then click the General tab. In Windows 2003 and XP, select the Always allow use of recognizable media without prompting check box. In Win2K, select the Always move new import media to the Backup media pool check box. Contrary to how NTBackup words this message, this operation doesn't actually allocate the tape to NTBackup; it merely moves the tape's entry to the NTBackup media pool.

How to Allocate Tapes to NTBackup
If you're starting with tapes that NTBackup doesn't recognize (e.g., tapes that have been used with a different version of NTBackup), you need to allocate them to NTBackup before you can use them in a schedule. One simple way to allocate an unused tape is to use it for a small backup job. To do this, open NTBackup. In Windows 2003 and XP, the Wizard Mode starts by default. Click Advanced Mode to switch to the Advanced Mode interface. (To always skip this initial dialog box, you can deselect the Always start in wizard mode check box.) There's no Wizard Mode interface in Win2K, so Windows 2003's and XP's NTBackup initial screen in Advanced Mode is similar to Win2K's NTBackup initial screen.

Windows 2003's and XP's Advanced Mode interface is almost identical to Win2K's NTBackup interface, so the next step in all three OSs is to select the Backup tab in the NTBackup UI. In the left pane, highlight your system disk. Make sure you only highlight the disk. (Don't select it for backup.) In the right pane, select a small file, such at boot.ini, as Figure 5 shows. From the Job menu, choose Save Selections. In the dialog box that appears, enter a sensible name (e.g., Prepare.bks) and click Save. When you return to the Backup tab, make sure New (Windows 2003 and XP) or New Media (Win2K) is selected in the Backup media or file name drop-down list box. Click Start Backup to display the Backup Job Information dialog box, which Figure 6 shows. The default entries in the Backup Job Information dialog box are generic, so you need to edit them to suit the task. The description you enter in the Backup description text box appears in the backup log file and in the Description column of the Restore and Manage Media tab (Windows 2003 and XP) or the Restore tab (Win2K) in the NTBackup UI. The label you enter in the second text box defines the tape name that will appear in the NTBackup and Removable Storage UIs. A good strategy is to define the label according to the role the tape will play in your backup rotation scheme (e.g., Monday 1, Friday 2). For this example, let's use the tape name Friday 1 because the backup will run the first Friday of every month. When you're ready to begin the backup, click the Start Backup button.

If the tape isn't empty, NTBackup displays a dialog box that states the tape contains data that will be replaced with the current job. Windows 2003 and XP display a dialog box similar to the one that Figure 7 shows. Figure 8 shows Win2K's dialog box. If you're sure you inserted the correct tape, choose Yes. NTBackup then backs up the file and allocates the tape to itself. You need to repeat this process for any new tapes in your rotation.

You can see the list of allocated tapes by opening the Removable Storage console. In the left pane, expand Media Pools, then Backup. Under the Backup media pool, select the pool that matches your tape drive's media type (e.g., Travan).

In some cases, you might get one or more error messages when attempting to allocate a tape to NTBackup. In these cases, you might need to deallocate and free a tape before you can allocate it successfully. To remove the tape's allocation information, right-click the tape in the Removable Storage console and choose All Tasks, Deallocate (answer Yes to all prompts). Next, right-click the tape again, choose Free (Windows 2003 and XP) or Prepare (Win2K), and answer Yes to all prompts. This will move the tape to the Free media pool. After completing these steps, try running the backup job again.

How to Create Scheduled Jobs
After all your tapes are allocated to NTBackup, you can use them in scheduled jobs. For this example, let's create a scheduled job that performs a full system backup on the first Friday of every month and that stores the backup on the Friday 1 tape. To create the scheduled job, go to NTBackup's UI (make sure you're using the Advanced Mode interface if you're running Windows 2003 or XP), and select the Schedule Jobs tab. Click the Add Job button in the bottom right corner to start the Backup Wizard. (If NTBackup asks whether you want to keep your selections before starting the wizard, choose No.) Click Next to advance past the wizard's opening page.

On the wizard's What to Back Up page, you need to tell NTBackup the data you want to back up. You can choose to back up everything (i.e., all files and folders on all disks, and the system state), a selected set of files and folders, or the system state only. For this example, we're backing up the entire server, so choose Back up everything on this computer and click Next.

The Backup Type, Destination, and Name page lets you select your tape drive's media pool and the tape you want to use for the job you're scheduling. In the Select the backup type drop-down list box, select your tape drive's media pool (e.g., Travan). In the
Choose the tape you want to use drop-down list box, select the tape. For this example, select Friday 1, then click Next.

On the Type of Backup page, you further define the backup type and whether to back up migrated remote-storage data. In this example, you want to perform a full backup of the server, so choose Normal. If your server uses the Remote Storage service, you can also select the option to back up migrated remote-storage data. Click Next.

In the How to Back Up page, you can choose to verify the backup data and choose to use hardware compression. In Windows 2003 and XP, you can also choose to disable the Volume Shadow Copy Service (VSS) if you're not backing up the system state. (Win2K doesn't have VSS.) It's not necessary to verify the backup data unless you suspect a faulty drive or tape. Using hardware compression is generally recommended because it can reduce your backup set size and the time needed to run the backup. It's also a good idea not to disable VSS (if available) without a good reason. For this example, disable the verify option, enable the hardware compression option, and click Next.

The Backup Options page asks whether you want to append to or replace data on media that already contains a backup. For this example, let's overwrite the tape each time, so choose the Replace the existing backups option. In addition, because the backup also contains the server's system state information, select the check box that allows only the owner and the administrator access to the backup data, then click Next.

The Backup Label page prompts you for a backup label (which is really the backup description) and a media label. NTBackup provides generic entries based on the current date and time. However, because the backup description will appear in the backup log and in the Description column of the Restore and Manage Media tab (Windows 2003 and XP) or the Restore tab (Win2K) in NTBackup's UI, you'll want to customize the entry in the Backup label text box. For this example, enter Friday 1 Full Server Backup as the description. You'll also want to customize the media label because when you select the Replace the existing backups option on the Backup Options page, the tape will be relabeled with the label you specify in this page. For this example, enter Friday 1 in the Media label text box because you don't want the label to change. Click Next.

In the When to Back Up page, you define the backup job's name and when it should run. The name you enter for the job will be the name of the scheduled task. For this example, enter Friday 1 Full Server Backup as the job name. Click the Set Schedule button to choose the scheduling options. In the Schedule Job dialog box, you need to configure when you want the job to run. For this example, schedule the job to run at 10 p.m. on the first Friday of every month, as Figure 9 shows. When you click OK to exit the dialog box, NTBackup will prompt you for the password of the current account. Alternatively, you can specify a different account's credentials. If you enter the credentials for a different account, Windows 2003 and XP display a warning message. (You don't get a warning message in Win2K.) This message appears because the backup selection list used for the current job is saved in the current user's profile, not in the other account's profile.

The wizard's final page displays all the options you chose on the previous pages. Click Finish and NTBackup creates the scheduled job. You can view the scheduled job's command by opening it from the Control Panel Scheduled Tasks applet. As part of the scheduled job, NTBackup saves the job's selections to a backup selection list (.bks) file in the %USERPROFILE%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data directory, where %USERPROFILE% is the profile directory for the current user, even if you specified that the job should run under a different account.

One caveat to using NTBackup's scheduling feature is that if an NTBackup job is scheduled to use a particular tape, that tape must be in the drive at the time the job starts. For example, if you leave the Thursday 1 tape in the drive and your scheduled Friday 1 backup job starts, NTBackup will abort the job because it requires the Friday 1 tape.

With NT 4.0's NTBackup utility, you could back up to an arbitrary tape, overwriting the tape's contents with the current backup. In XP and Win2K, NTBackup documentation mentions that you can do so only if you run NTBackup from the command line and you use the /um (unmanaged) option. This option lets NTBackup use the first tape it can find. As such, it's suitable for use only with standalone tape drives. This option isn't documented in Windows 2003, but my testing shows that it works.

Keep in mind that if you use the /um option in a scheduled job, the tape will be relabeled with either the label you specify with the /n option or a default label if you don't specify the /n option. If you forget to change tapes between jobs, be aware that your tape's media label might change. For this reason, Microsoft recommends not using /n with /um to avoid duplicate logical media labels. For more details about this recommendation, see the Microsoft article "How to Schedule Unattended Backups by Using a Stand-Alone Tape Library" (http://support.microsoft.com/?kbid=314844). Also, /um can't be combined with /a, so you can't append to existing tapes using /um. For more information about NTBackup's command-line options, see the sidebar "Running NTBackup from the Command Line."

How to Remove a Failed Tape
When a tape fails in your rotation, you'll probably want to remove the failed tape's entry from the drive's media pool. If you don't do this and you prepare a new tape for NTBackup with the same media label, you'll have two identically named entries in the Removable Storage database. This situation is not only confusing but also has a more serious consequence: Scripted backups that use the /t (tape name) option will fail because NTBackup won't know which tape to use.

Before preparing the replacement tape, you need to tell the Removable Storage service that the tape no longer belongs to NTBackup by deallocating the failed tape's entry. To do this, open the Removable Storage console, right-click the tape that failed, choose All Tasks, then click Deallocate. When you're prompted to confirm this operation, choose Yes. Next, move the failed tape's entry to the free media pool by dragging and dropping the failed tape's entry into the free media pool for your media type, then click Yes in the confirmation prompt. After the unmounted tape's entry is in the free media pool, you can delete it from the Removable Storage database.

The Idiosyncrasies Revealed
The NTBackup utility in Win2K and later is a much more versatile tool than its NT counterpart because of its media-management and scheduling features. Although NTBackup still lacks many enterprise-friendly features, such as administrative status notifications, it's adequate for most small installations. I hope that the information I presented here explains some of its idiosyncrasies and paves the way to a successful backup strategy.

Project Snapshot: How to
PROBLEM: Upgrades to NTBackup have made the utility confusing and even difficult to use, especially if you've just migrated from NT to Windows 2003.
WHAT YOU NEED: Windows 2003's, XP's, or Win2K's built-in NTBackup utility
DIFFICULTY: 3 out of 5
PROJECT STEPS:
  1. Understand how NTBackup, the Removable Storage service, and Task Scheduler interact with each other.
  2. Allocate tapes to NTBackup.
  3. Create a scheduled job.
  4. Remove a failed tape.