Functional Description of Windows Server 2003 Data Storage
The Windows Server 2003 storage system supports three different disk partitioning schemes, which Microsoft associates with three different disk types as follows:
- Basic MBR disks.
This partitioning scheme uses the classic Intel Master Boot Record (MBR). The MBR contains a data structure called a partition table that defines up to four partitions that can be used to store data. - Basic GPT disks.
This partitioning scheme is available only on IA64 systems. It uses a new form of partition table that can define up to 128 partitions, each identified by a Globally Unique Identifier (GUID). - Dynamic disks.
This partitioning scheme is used on dynamic disks in Windows Server 2003, Windows XP, and Windows 2000. Partition information is stored in a database controlled by a service called the Logical Disk Manager (LDM ) . Both IA32 and IA64 systems can have dynamic disks. On IA32 systems, a copy of the LDM database is stored in the final cylinder of each dynamic disk. On IA64 systems, the LDM database is stored in a Microsoft Reserved Partition near the beginning of the disk.
Logical Disk Manager Volume Configurations
The database managed by the Logical Disk Manager replaces Registry-based classic NT disk sets supported by Ftdisk. The Ftdisk driver has been relegated to middle management where it is responsible for handling basic MBR and GPT disks.Under normal operation, with each disk holding its own discrete data, there is no need for anything other than basic disk with partition information stored in an IA32 MBR or IA64 GPT. The same is true for hardware RAID arrays, where the logical disk constructed by the RAID controller appears to the operating system as a single, large basic disk.The Logical Disk Manager comes into play when you want more sophisticated disk configurations in software. This is when you would convert the basic disks to dynamic disk then use the LDM to create one or more of the following volume configurations:
- Simple volume.
This is the equivalent of an MBR or GPT partition. When you create a simple volume, you set aside a certain portion of a disk for use by a file system. There is room in the LDM database for thousands of simple volumes, but it's not likely you'll want more than a handful. - Spanned volume.
This volume type links together free space on the same disk or from other disks to form a single logical drive. Spanned volumes are the equivalent of classic NT volume sets. - Striped volume.
This is a RAID 0 configuration. The data stream is divided into chunks that are written to separate disks. Striped volumes have performance advantages, especially when use with a high-speed data bus, but they increase the likelihood of data loss because a single drive failure disables the entire volume. - Mirrored volume.
This is a RAID 1 configuration. The same data stream is directed onto two disks simultaneously. The file systems on the mirrored volumes remain available if either disk fails. If the disks are on separate controllers, the volume is said to be duplexed . Mirrored volumes exhibit fast seek times because either disk can respond to a read request, but they are slower than single disks for writing because data must be written to two disks simultaneously. - RAID 5 volume.
In this configuration, the data stream is divided into chunks that are written to multiple disks along with parity information. See the sidebar "RAID 5 Operation" for more information. RAID 5 represents a compromise between performance, fault tolerance, and flexibility. It is slower than striping or spanned volumes but provides fault tolerance. It is slower than mirroring but makes more effective use of storage capacity.
LDM does not support more modern configurations such as RAID 0+1 (striping with mirroring) or RAID 10 (mirroring with striping).
RAID 5 OperationIf you've never experimented with fault tolerant drive configurations before, try setting up a three-disk RAID 5 array in your lab and then pulling the power plug on one of the drives. You'll get a small notification bubble message from a drive icon in the System Tray and that's about it. The logical drive is still available, albeit with slightly reduced performance.RAID 5 accomplishes this magic by calculating and storing parity information that can be used to reconstitute the contents of a lost disk should one fail. This parity calculation uses a XOR, or exclusive OR, function. A XOR calculation works like a party game:
Table 14.1 shows a XOR truth table.
|
LDM Database Structure
Let's avoid grunt-level detail here and just get a feel for how the LDM database is laid out on the disk. This information helps you to understand what you'll see if you use disk utilities. It will also help you avoid making changes that could render the LDM inoperable (and your data unavailable).Figure 14.1 shows a block diagram of the LDM database structures stored on a disk. Here are the components:
- Private Header.
This has entries describing where to find the LDM database and generally defining what's inside. There are multiple copies of this header for fault tolerance. - Table of Contents.
This is a quick index of the database contents. Redundant copies are stored at the end of the disk for fault tolerance. - Volume Manager.
This is the database itself. - Virtual Blocks.
These are the database records, one for each partition, disk, and volume. At 256 bytes per record, there is enough space in the database for thousands of records. Microsoft recommends putting no more than 32 elements in the database. Personally, I think if you have more than one fault tolerant storage element in a server, you need to use hardware RAID. - Transaction Log.
This is a set of two sectors that hold uncommitted updates to the database to protect against a possible power loss or some other critical failure.
Figure 14.1. Diagram of Logical Disk Manager disk structures.

When you add a new dynamic disk to a system, either by promoting a basic disk or creating a new volume on an existing dynamic disk, the system adds a new Virtual Block to the Volume Manager. (This is the equivalent of adding a new record to the LDM database.) Each element (record) in the database is assigned a Globally Unique Identifier, or GUID. The GUID acts as a key for the record.You can view a pile of details about the LDM database contents and structure by using the DMDIAG utility in the Support Tools. Here is a sample listing (the /v (verbose) switch gives ten times this amount of information):
[View full width]C:\>dmdiag.exe
---------- Dynamic Disk Information -----------
DiskGroup: S1Dg0
Group-ID: e129db61-e6d5-4ff0-9d2e-660f570cc315
Sub Disk Rel Sec Tot Sec Tot Size Plex Vol Type Col/Ord DevName State
======== ======= ======= ======== ==== ======== ======= ===============
Disk1-01 0 10667097 0 Volume1-01 Simple 1/1MISSING
Disk1-02 10667097 204800 0 Volume2-01 Simple 1/1MISSING
Disk1-03 10871897 204800 0 Volume3-01 Simple 1/1MISSING
Disk1-04 11076697 1042177 0 Volume4-01 Mirror 1/1MISSING
Disk1-05 12118874 473088 0 Stripe1-01 Stripe 1/2MISSING
LDM-DATA 0 0
Disk2-01 63 8385867 12594960 Volume5-01 Simple 1/1 Harddisk0ONLINE
Disk2-03 10442250 2136645 12594960 Volume7-01 Simple 1/1 Harddisk0ONLINE
Disk2-04 8385930 1028160 12594960 Volume4-02 Mirror 1/2 Harddisk0ONLINE
Disk2-05 12578895 14017 12594960 Volume4-02 Mirror 1/2 Harddisk0ONLINE
Disk2-02 9414090 473088 12594960 Stripe1-01 Stripe 2/2 Harddisk0ONLINE
LDM-DATA 12592912 2048
---------- LDM Volume Information -----------
Volume Volume Mnt Subdisk Plex Physical Size Total Col PlexRel Vol Plex
Name Type Nme Name Name Disk Sectors Size Ord OffsetSectors State State
====== ====== === ======== ========== ========== ======= ======= === ============= ====== ======
Volume1 Simple C Disk1-01 Volume1-01 10667097 10667097 1/1 00 ACTIVE ACTIVE
Volume2 Simple R Disk1-02 Volume2-01 204800 204800 1/1 010667097 ACTIVE ACTIVE
Volume3 Simple S Disk1-03 Volume3-01 204800 204800 1/1 010871897 ACTIVE ACTIVE
Volume5 Simple Disk2-01 Volume5-01 Harddisk0 8385867 8385867 1/1 063 ACTIVE ACTIVE
Volume7 Simple Disk2-03 Volume7-01 Harddisk0 2136645 2136645 1/1 010442250 ACTIVE ACTIVE
Volume4 Mirror D Disk1-04 Volume4-01 1042177 1042177 1/1 011076697 ACTIVE ACTIVE
Volume4 Mirror D Disk2-04 Volume4-02 Harddisk0 1042177 1028160 1/2 08385930 ACTIVE ACTIVE
Volume4 Mirror D Disk2-05 Volume4-02 Harddisk0 1042177 14017 1/2 102816012578895 ACTIVE ACTIVE
Stripe1 Stripe E Disk1-05 Stripe1-01 946176 473088 1/2 012118874 ACTIVE ACTIVE
Stripe1 Stripe E Disk2-02 Stripe1-01 Harddisk0 946176 473088 2/2 0414090 ACTIVE ACTIVE
LDM Group Names
Each dynamic disk is part of a disk group . Members of a disk group share the same LDM database. Windows Server 2003 can only have one disk group. (The commercial version of LDM from Veritas supports multiple disk groups.)The disk group is given a name comprised of the computer name followed by the letters Dg0. For example, the dynamic disks on a server named SRV1 would have a group name of Srv1Dg0.If you revert all dynamic disks in a server back to basic disksthis require removing all volumes, converting the drives, then restoring the data from tapethe next disk converted to a dynamic disk would start a new group named Srv1Dg1.Group names play an important role when swapping dynamic disks between servers. If you put dynamic disks into a server, you can import the contents of the LDM database on those disks. When you do this, the disks are made part of the local disk group. For example, if you take disks out of server SRV1 and import them into the LDM database in SRV2, the disks would be given the new group name of Srv2Dg0.The Registry keeps track of the disk groups in a machine. You cannot boot from a dynamic disk that is in a different disk group. For example, let's say the disk you imported into server SRV2 was a boot disk. During the import, the disk was added to Srv2Dg0. If you took this disk out and put it back into its original server, you would get a 0x0000007B, Inaccessible Boot Device, blue screen stop as soon as the system compared the disk group name in the Registry with the name in the LDM database. There is no workaround for this, so use extreme caution when moving dynamic boot disks.If you take dynamic disks from one server and put them in a server that has no dynamic disks of its own, the system behaves like a cubless she-wolf and adopts the new disks as if they were her own. The disks retain their original disk group name, which includes the name of the original server, not the server into which they were imported. The system assigns this name to any subsequent dynamic disks. If you find a system with a disk group name that doesn't match the computer name, this is the most likely cause.
Restrictions on Dynamic Volumes
A few restrictions apply when creating dynamic volumes:
- The Disk Management console only offers NTFS as the format option for a dynamic volume. You can create the volume and use the FORMAT command to create a FAT or FAT32 volume.
- Spanned volumes that include multiple disks cannot be mirrored.
- Striped and RAID 5 volumes cannot be mirrored.
- Only simple volumes can be spanned.
- The system and boot volumes can be mirrored but cannot be striped or spanned.
Barring these few restrictions, you can create as many different volumes on the dynamic disks in a system as you need. Keep in mind that the storage subsystem must respond to file system requests from all those volumes, so don't degrade performance by configuring lots and lots of volumes.Also, avoid mixing IDE/ATA drives and SCSI drives in the same volume set. You put additional pressure on the storage subsystem to track data packets from two very different sources. The same is true of mixing radically different SCSI drives on the same bus or different SCSI host interface adapters in the same array.For the most part, you can achieve acceptable performance and fault tolerance by mirroring a pair of drives for the operating system and then creating a RAID 5 volume set using at least three drives on another interface. Use SCSI drives to take advantage of the increased thread handling capabilities and more robust bus management subsystem.
XP and LDM
LDM in Windows XP does not permit creating fault tolerant volumes such as RAID 5 and mirrored drives. You can create simple volumes or striped volumes and you can span volumes. There is no architectural reason for this limitation; it merely differentiates the desktop product from the server product. This limitation has been present in all versions of classic NT and Windows 2000.If you create a fault tolerant volume on a server, you can import the disks onto a desktop running XP. I do not recommend this practice because you never know when Microsoft might do something in the code to preclude this configuration.It's worth noting here that the Home Edition of XP does not support dynamic disks of any form. You cannot install the Home Edition onto a dynamic disk and you cannot import a dynamic disk from another system into a system running Home Edition.
When to Use Dynamic Disks
Dynamic disks have one benefit:
They permit you to smear data across multiple disks. There is no performance advantage to using a simple volume on a dynamic disk compared to a basic partition on the same disk. Performance is determined by the speed of the drives, the I/O path, and the file system. Dynamic disks are just as susceptible to viruses as basic disks because the executable code in the Master Boot Record and partition boot sector is unchanged.This means you do not need a dynamic disk on a system with only one drive. Converting disks on laptops is restricted by a Registry setting because the laptop may connect to a docking station with an additional drive. It would cause problems for the LDM if the databases on the two drives were to get out of sync.Many servers use hardware RAID. A RAID controller presents a virtual disk to the operating system. There is no benefit to converting this virtual disk from basic to dynamic. This was occasionally necessary under Window 2000 to permit expanding volumes by adding new storage to the array and then spanning to the unallocated space. Windows Server 2003 permits expanding basic disk partitions, so there is no need to convert.If you decide to use the software-based RAID in Windows Server 2003, you'll like these features:
- Disk reconfigurations (other than the initial conversion of the system/boot disk) do not require rebooting.
- Dynamic volumes can be remotely managed, both from the Disk Management console and the command line using Diskpart.
- The LDM database is replicated to each dynamic disk, improving reliability.
- The database is on the drives themselves so you can move a drive assembly into another machine and quickly access the data.
- You can boot from a fault tolerant boot floppy to the secondary drive of a mirrored volume without breaking the mirror. This was not possible in classic NT using Ftdisk because the Registry on the mirrored disk was locked.
- You can move drives around within a server and retain their logical disk location within their volume sets. This added bit of flexibility is a significant improvement over classic NT Ftdisk sets.
Dynamic Disks and Hardware RAID
The chief advantage to software RAID is its price. You can't get better than free . But even free has its price. Ask anyone who has attended a timeshare presentation just to get the free trip to Hawaii.Dynamic disks do not provide the same kind of comprehensive feature sets found in hardware RAID controllers. This includes the following:
- No support for hot-swappable disks
- No hot-standby disks
- No dynamic growth when adding new disks
- No automatic partition management
- Not as capable of protecting data during some types of drive failure
In addition, hardware RAID is faster than software RAID, all other things being equal. If price is more important than performance, vendors such as Promise, IBM, Adaptec, and others now offer ATA RAID controllers at competitive prices.Still, you can't beat free. If your budget is tight and your CIO or business owner or client can't or won't spend the money on hardware RAID, by all means make use of dynamic disks.
Basic Disk Conversion
LDM-based dynamic volumes have lots of advantages over classic MBR partitioning, but they have their eccentricities, most of which have to do with booting and backward compatibility. To understand these eccentricities, we need to get familiar with some of the basic structures on an MBR disk.Figure 14.2 shows a diagram of a Master Boot Record. The MBR contains a few hundred bytes of executable code designed to scan a data structure called a Partition Table , which is also in the MBR. One of the entries in the Partition Table should be marked as "active," meaning that it can be used to boot the machine.
Figure 14.2. Diagram of key Master Boot Record elements and partitioning information.

The MBR code then goes out to the location specified by the partition table entry and loads the sector at that location into memory. This sector, the partition boot sector, contains bootstrap code that is capable of finding and loading either an operating system or a secondary bootstrap loader. In the case of Windows Server 2003, the secondary bootstrap loader is Ntldr.This configuration changes somewhat when you convert the disk from a basic disk to a dynamic disk. Figure 14.3 shows the MBR and partition information following conversion to a dynamic disk. Several things happen during the conversion:
- An LDM partition is added to the end of the drive.
- The partition table entries from the MBR are added to the LDM database as simple volumes. Volumes are created for every primary partition and every logical drive within an extended partition.
- If the system already has dynamic disks, the new disk and its volumes are merged into the existing LDM database on those disks and the result is copied to the LDM database on the new disk.
- The logical drive letters assigned to the basic partitions by the Registry are retained for the newly created dynamic volumes.
- The partition table is modified to retain only the partitions required for INT13 access to the disk.
Figure 14.3. Diagram of Master Boot Record following conversion to a dynamic disk.

The user interface shows only a few changes. Explorer remains the same. The Disk Management console shows the disk status as Dynamic and On-Line. It identifies the volumes with a different color scheme. Unallocated space on the disk can now participate in dynamic volume structures such as spanning, mirroring, striping, and RAID 5.
Conversions Requiring Restart
If you convert a basic disk that holds any of the following components, you must restart the system to complete the conversion:
- System files
- Boot files
- Paging files
- Crash dump files
The restart permits the system to create the necessary LDM database entries and Registry entries prior to mounting the file systems. Here is a quick rundown of the operations:
- An Encapsulation Info key is placed in the Registry under HKLM | System | CurrentControlSet | Services | DMIO with a binary value of FDISK Data showing the structure of the partitions on the disk.
- An EncapsulationPending key is put under HKLM | System | CurrentControlSet | Services | DMLOAD with no values. It acts as a flag to notify the system to make the change to the Master Boot Record and construct the LDM database using the information in the Encapsulation Info key.
- The system restarts, makes the change, and then you are prompted to restart again with the message that the system has found new hardware. This is because the dynamic disk participates differently in the Windows Server 2003 object namespace than a basic disk.
Prerequisites and Restrictions for Converting Basic Disks
Here is a quick checklist to use when planning a disk conversion. If one of the restrictions prevents you from doing the conversion, your only alternative is to remove the existing partitions (after backing up the data, of course), converting the disk, configuring the dynamic volumes, and then restoring the data to the new volumes:
- You cannot convert a disk with existing partitions if there is no room for the LDM database at the end of the disk. The database takes a minimum of 1MB but it must align to a cylinder boundary, so the actual size depends on the geometry of the disk.The system will resize any existing partitions to make room for the LDM partition. If this resizing fails, the disk cannot be converted. About the only time this would happen is if you have a foreign partition (third-party partition manager, Linux, and so on) as the final partition on the drive.If you have SCSI drives, the system will put the LDM database in the area of the disk set aside for sector sparing. This can dramatically reduce the cushion you have for handling sector failures. NTFS supports sector sparing in software, so this should not present a problem.
- You cannot convert detachable or removable disks to dynamic disks. Each dynamic disk has a copy of the LDM database. It would cause the LDM subsystem to become unstable if a copy of the database were on a removable platter.
- You can only read dynamic disks using Windows Server 2003, Windows XP, or Windows 2000.
- You cannot convert a dynamic disk back to a basic disk without first removing all volumes. This involves erasing all data, so it's vital to have a recoverable backup.
- The system files Ntdlr, Ntdetect.com, Boot.ini, Bootsect.dos, and Ntbootdd.sys can reside on a dynamic disk but they must be on a simple volume or a mirrored volume.
Booting and Dynamic Disks
When you boot an Intel computer, the system BIOS performs a series of INT13 calls to locate the bootstrap code for the operating system. (PCs built to PC97 specifications or later use extended INT13 calls that understand modern drive geometries.)The INT13 service routines cannot read the LDM database. Without a standard partition table entry, the BIOS cannot locate an operating system partition. For this reason, when you convert a basic disk to a dynamic disk, the system retains the partition table entry for the system partitionthat is, the partition that contains the bootstrap code. There are a couple of subtleties to this operation:
- It's possible that the system partition is not the first partition on the disk. If that is the case, sufficient partition table entries will be retained to permit INT13 to locate the system partition.
- It's possible to boot the operating system from a logical drive in an extended partition. For this reason, the partition table entries for all extended partitions are retained.
Keep in mind that you cannot boot to a drive that contains only dynamic volumes. If you mirror your system drive, be sure to partition the drive first and then delete the partition and mirror it. This creates a bootable partition in the MBR.An INT13 call does not see the data boundaries created by the LDM database. For this reason, be very careful when using any disk utilities that run outside of the Windows operating system. This includes partition managers such as BootIt and Partition Magic, boot-time defragmentation features in Diskeeper and PerfectDisk. This also includes the Setup program and the Recovery Console, which relies on the drivers in Setup. See the next section for more details.
Setup and Dynamic Disks
You can install Windows Server 2003 onto a disk that has been previously configured as a dynamic disk. Before going over the inevitable restrictions and prerequisites, let's review what happens when you run Setup on a basic disk. (If you are new to Windows system administration, take a quick look at the sidebar "Boot and System Partitions." The nomenclature can be a little confusing.) Here's the review:
- If you elect to install both the system files and boot files into a single partition, Setup creates a single primary partition and gives it drive letter C. This is usually the first partition on the drive, although it does not have to be. Setup also marks this partition as "active," meaning that the BIOS boot routine will load the boot sector from that partition.
Creating a Bootable Drive
IfBuilding a Fault Tolerant Boot Floppy" for instructions on creating the floppy.When you've booted the operating system, load the Diskpart console and issue the following commands (the example assumes the disk is the first disk in the array and the volume is the first on the disk):
DISKPART> Select Disk 0
DISKPART> Select Volume 1
DISKPART> Retain - If you elect to install the boot files and system files in separate partitions, Setup marks the partition containing the system files as "active" and gives it drive letter C. This is typically the first partition on the drive. The remaining partitions you specify in Setup become logical drives in a single extended partition. Setup will not create more than one primary partition.
The purpose of these rules is to ensure that the INT13 BIOS service routines can find the bootstrap code in the system partition and the operating system files in the boot partition.If you install Windows Server 2003 onto a dynamic disk, the BIOS must still be able to find the bootstrap code and the operating system files. With this in mind, here are the prerequisites and restrictions:
- If the system or boot volume is mirrored, you must break the mirror before installing or upgrading to Windows Server 2003. You can remake the mirror later after installation.
- You must select a partition displayed by Setup. These represent volumes that are anchored to classic MBR partition table entries. Other dynamic volumes within these volumes are not displayed, so don't delete them unless you're sure they do not contain data.
- There will not be any unallocated space beyond the listed partitions. When you select a partition, Setup will probably find an existing Windows operating system. You can elect to overwrite that operating system.
To avoid data loss, you should avoid installing Windows Server 2003 onto a dynamic disk unless you are diagnosing a problem by installing a parallel version of the operating system.
Partition and Volume Extensions
Growth is everywhere. 50 million years ago, horses were the size of a small dog. In 1930, the astronomer Edwin Hubbell proved beyond a shadow of a doubt that the universe is expanding. In 1965, Gordon Moore postulated that the rate of on-chip transistor density would double at a more or less steady rate. In 1999, Michael Dell made more money in one month than any person in history.Still, nobody understands growth like a system administrator. And I'm not talking about the kind of growth that comes from eating too many chocolate donuts while troubleshooting a service outage. I'm talking about data growth. No matter how generously you size your storage systems, in a blink of an eye you're at a 90 percent loading factor. Let's see how we can use the LDM to respond to that kind of growth.
Basic Disk Partition Extensions
When you add more storage, you generally stuff more drives into an array of some sort, either a locally attached RAID controller or a Storage Attached Network (SAN) box of some sort. The additional storage appears in the operating system as unallocated space.Under Windows 2000, if you wanted to expand an existing volume to encompass that new space without creating a new logical drive, you were forced to convert the virtual disk presented by the RAID controller to a dynamic disk so you could span volumes. Under Windows Server 2003, you can extend a basic partition without going through the hassle of a disk conversion. If you dual-boot between Windows Server 2003 and Windows 2000 or NT, the extended partition is accessible by the earlier operating systems.Here are the restrictions for extending basic disk partitions:
- The partition must be formatted as NTFS. If it is currently formatted as FAT or FAT32, you can convert it using the CONVERT utility. The new CONVERT utility in Windows Server 2003 is fast and permits you to control the cluster size.
- The unallocated space must be on the same drive as the existing partition. You cannot span basic partitions across disks.
- The unallocated space must be contiguous to the basic partition you want to expand.
After you extend the partition, the space appears in Explorer as free space in the existing logical drive. See the section, "Performing Disk Operations on IA32 Systems," for the procedure to extend a basic partition.
Dynamic Disk Volume Extensions (Spanning)
You can add space to a dynamic volume by spanning to unallocated space elsewhere on the drive. You can also span across drives. This configuration has several restrictions:
- You can span a simple volume or an existing spanned volume. You cannot span striped, RAID 5, or mirrored volumes.
- You cannot span a system volume (the volume used to boot the operating system). This is because the BIOS locates the volume using INT13 calls, which rely on standard partition information in the MBR.
- You cannot span a boot volume (the volume that contains the operating system files) for the same reason as the system volume.
- You cannot span a volume that is anchored to a classic partition table entry. This was an issue under Windows 2000 because it retained the old partition table. Windows Server 2003 changes the structure of the partition table to eliminate most of the primary partitions.
The chief advantage of volume spanning using dynamic disks over partition extension using basic disks is the capability to span volumes across multiple disks. Ordinarily, you would avoid this configuration because it lacks fault tolerance. However, if you use a SAN for storage or some other fault-tolerance subsystem capable of presenting multiple virtual drives, you can span volumes across those virtual drives while retaining fault tolerance.See the following section for the procedure to span a dynamic volume.