Section 6.1. Disks, Partitions, and Volumes

   

6.1 Disks, Partitions, and Volumes

The term disk is used to refer to physical media such as IDE or SCSI drives, as well as to removable media disks such as USB drives and CD-ROM or DVD disks. A disk is logically thought to consist of multiple clusters that are specified in terms of the amount of data that a cluster can store ”for example, 512 bytes, 1,024 bytes, 4,096 bytes. The term disk is always used to refer to a physical entity that one can touch and feel. In contrast, the terms partition and volume , explained in the next couple of paragraphs, represent logical concepts.

For administrative purposes, some disks (but not all) [1] may be divided into multiple logical divisions called partitions . Each partition has a capacity specified in the amount of data the partition can hold, and this value is an integral number of cluster units. For example, a disk with an 80GB capacity might be divided into two partitions ”one dedicated to installation of the operating system and utilities, and the other dedicated to user data. Another popular reason for having a small separate partition on enterprise servers is to install some diagnostic programs on the partition.

[1] Some examples of disks that are not divided (i.e., have only a single partition) are CD-ROM disks and DVD disks.

A volume is a collection of one or more partitions. The combination may be for purposes of ensuring speed, capacity, data integrity, or a combination thereof. For example, two partitions may be concatenated to ensure a larger volume, or two partitions of equal size may be combined into a single mirrored volume in which the data is duplicated on each partition. These ideas are expounded further later in this chapter and in the description of RAID in Chapter 9. Note that there are some caveats as to how partitions may be combined; depending on the type of disk and the version of the Windows Server operating system. These caveats are also examined in more detail in this chapter.

To be concise , file systems reside on volumes. Volumes consist of one or more disk partitions. Disk partitions are logical divisions of a physical disk. Figure 6.1 shows this layering. The top layer is the file system layer, the next is the volume layer, and the bottom layer is the disk partition layer.

Figure 6.1. Disks, Partitions, and Volumes

graphics/06fig01.gif

Figure 6.1 shows NTFS on volume V1, which itself is built by concatenation of the partitions D1-P1 and D2-P2. NTFS is also installed on volume V2, which is built by mirroring of partitions D1-P2 and D2-P1 (which must be identical in size). To indicate that volume V2 is constructed differently, the relationship between the volume and the constituent partitions is shown with dashed lines. FAT is installed on volume V3, which is built on just one partition, D3-P1. Disk D1 is divided into two partitions: D1-P1 and D1-P2. Disk D2 is divided into two partitions: D2-P1 and D2-P2. Disk D3 is divided into just a single partition, D3-P1. Note that this figure is illustrative and does not represent all possible ways of building volumes.

With these concepts in mind, we can look more closely at details. In particular, the explanation of a partition as simply a collection of disk clusters left out some important details, such as how an operating system collects data on the number of partitions that exist on a particular disk and where a particular partition begins and ends. The answers to these questions are a little involved and are explained in Sections 6.1.1 (Basic Disks) and 6.1.2 (Dynamic Disks). In addition, as will be explained, whereas partitions on basic disks are called hard partitions , partitions on dynamic disks are called soft partitions . The terms are meant to reflect the fact that hard partitions are fixed in size (and cannot be extended or shrunk), whereas soft partitions may be shrunk or extended, even while they are actively being used.

One further caveat should be noted. This book refers to a hierarchy of disks being divided into partitions and partitions being combined into volumes. Beware, however, that a lot of literature uses the terms volume and partition interchangeably, especially when assuming that a volume consists of only a single partition. Further, a lot of literature also uses the terms partition and disk interchangeably. Throughout this discussion, keep in mind that there is a three- tier hierarchy here. Physical disks are subdivided into logical entities called partitions , and these logical entities can then be combined in some fashion into yet another logical entity, called a volume . File systems always use volumes.

6.1.1 Basic Disks

The idea of dividing disks has been around for a while. The term basic disk was coined in the Windows 2000 time frame to describe disks that have a legacy DOS-style mechanism of describing how a particular physical disk has been divided into logical partitions.

The first physical sector on any disk, regardless of whether it is a basic disk or a dynamic disk, is special. This sector contains a data structure called the Master Boot Record ( MBR ) that provides information about how the disk is organized and also plays a role in booting the system. The MBR is always the same in the PC world, no matter what the operating system. It can be up to 512 bytes in size and always consists of four elements:

  1. A boot program that can be up to 442 bytes in size. This code is responsible for scanning the partition table (described below), locating the start sector for the active partition, loading the contents of this sector into memory, and transferring control to this code in memory.

  2. A 4-byte unique number called the disk signature . The disk signature is always located at offset 0x01B8 (from the start of the sector) and is used as an index to the registry to store and retrieve information about the disk.

  3. A partition table that can have up to four entries. The first entry is always at offset 0x01BE, and each entry is exactly 16 bytes long. One of the partitions described in this table is marked as the primary partition. This is the partition from which the system is booted . The first sector of each partition is referred to as the volume boot sector (VBS) and is similar in concept to the MBR. The difference is that there is only one MBR per physical disk, but there is one VBS per partition. Thus a single physical disk may have multiple volume boot sectors existing on it. Each VBS has information about the volume, such as the size, number of sectors, and label. The VBS also contains the actual boot code, which is loaded and executed by the boot code on the MBR.

  4. An end-of- MBR marker that is always set to 0x55AA.

Notice that the MBR can accommodate only four partition entries, implying that the disk can be subdivided into a maximum of four partitions. To provide for more than four partitions, one of the four partitions may be designated in a special manner (called an extended partition ), and that partition may itself have another partition table. This recursion of partition tables can theoretically continue without any limit.

Basic disks are supported as legacy devices on Windows 2000, Windows XP, and Windows Server 2003. Although this support is welcome, it is not without some caveats.

One caution is that Windows 2000, Windows XP, and Windows Server 2003 do not support the creation of fresh complex volumes from hard partitions existing on basic disks. Complex volume is a term used to refer to volumes that combine hard partitions from different basic disks. An example of a complex volume is a volume that concatenates two hard partitions existing on two different basic disks to create a single large volume. Such a volume was called a spanned volume in the Windows NT 4.0 time frame. On basic disks, existing spanned volumes can be supported in Windows 2000 and Windows Server 2003, but new ones may not be created.

Legacy complex volumes that were already created in the pre-Windows 2000 time frame may be imported and are indeed supported by Windows 2000, Windows XP, and Windows Server 2003.

Basic disks have some drawbacks. For one, they are highly sensitive to any corruption or failure of the first sector containing the MBR. Only a hardware RAID (redundant array of independent disks) solution will suffice. Software RAID cannot help for several reasons. (RAID is discussed in Chapter 9.) The MBR data is not duplicated by software RAID, and for a very good reason: When the system is booting and the MBR is accessed, the software RAID driver has not yet been loaded; hence it cannot help fix any data corruption in the MBR.

Another drawback is that configuration changes to basic disks need a system stop and restart.

6.1.2 Dynamic Disks

Windows 2000 introduced the concept of dynamic disks . Dynamic disks are designed to overcome the limitations of basic disks.

Dynamic disks can be reconfigured on the fly, even while applications (and file systems) are accessing the disk. The server does not need to be restarted for the new configuration to be visible. Volumes on a dynamic disk can be reconfigured without access to the volume having to be interrupted or the system having to be rebooted. Dynamic disks also are more fault tolerant than basic disks because essential disk configuration information is stored redundantly, both within a single physical disk and also replicated across other physical disks that are members of the same disk group .

As shown in Figure 6.2a, each dynamic disk maintains a 1MB database (the Logical Disk Manager, or LDM, database) at the end of the (physical) disk. In an effort to prevent data corruption (e.g., from a legacy utility or a foreign operating system), all dynamic disks still have the MBR, just as basic disks do. For dynamic disks that do not have operating system files on them, the MBR is constructed to show that a single partition encompasses the entire disk.

Recall that Windows NT has the concept of a boot partition and a system partition. [2] The boot partition is where the operating system files, such as all the files in the WinNT directory, are stored. The system partition is the one where the boot code exists. Because the Windows NT booting code does not understand dynamic volumes at all, the MBR is sometimes (when the disk has the system partition on it) constructed to show a partition so that the necessary boot code may be located and executed.

[2] This terminology is confusing for more than one reason. The first issue is that file systems exist on volumes; hence the correct terminology should be boot volume and not boot partition. The second thing to remember is that the boot code is on the "system" and the operating system files are on the boot volume. The terms appear to be opposite of what one would expect. The justification is that the names should be used in the "to"sense and not "from" ”that is, boot to this volume and not boot from this volume.

Figure 6.2. (a) Dynamic Disk Layout; (b) LDM Database Mirrored within Disk Group

graphics/06fig02.gif

Dynamic disks are organized in groups; however, the Logical Disk Manager (LDM) can support only one disk group. We construct a name for the default (and only) disk group supported by the LDM by appending the string "dg0" to the end of the computer name . As Figure 6.2b shows, this database contains information about all dynamic disks within the group and is replicated across all physical disks within the group, providing an element of redundancy and data protection. Figure 6.2b shows just two disks within the disk group, but there may be more. The database contains not just disk organization information, but also mount details for volumes ”that is, the drive letter or directory to which the volumes on that disk are mounted.

In essence, dynamic disks keep all information pertaining to a disk on the disk itself, and for this reason they are sometimes referred to as self-describing disks . In contrast, the mount information (drive letter) for basic disks is kept in the system registry.

Although dynamic disks are the favored format for the Windows NT family of operating systems, note that, as always, there are two sides to every coin. Disadvantages of dynamic disks include the following:

  • They have a format that renders the disk unreadable to operating systems other than Windows 2000 or later versions when directly read by the operating system, as in a direct-attached disk or a disk attached to a fabric switch accessed by a server. Other operating systems can still access the disk by using a Windows 2000 server and connecting to a share created by the Windows 2000 server.

  • Dynamic disks are not supported on laptops or removable storage such as Iomega Jazz and removable 1394/USB hard drives.

  • The Microsoft Cluster Server does not support the use of dynamic disks on the cluster-shared SCSI bus, unless the VERITAS Volume Manager is also deployed. On a purely speculative note, the reasons appear to be both technical and legal in nature. Recall that only the VERITAS Volume Manager supports multiple disk groups. Clusters are often used in an active-active mode. Considering the simplest case of a cluster, a two-node cluster, one would typically divide the disk resources into two groups and assign one group to each node. When any one node failed, the disk group belonging to that node would fail over to the other node. This means that one would need two disk groups, and hence the natively shipping Logical Disk Manager, which can handle only one disk group, would not be able to handle the situation.

  • The only way to convert a dynamic disk back to a basic disk is to back up all the data to another medium, reformat the disk, and restore the data.

  • Support for dynamic disks is still a work in progress. In particular, because essential components such as the boot-time code do not understand dynamic disks, some elements of old-style hard partitions are still retained in the Windows operating system. Also dynamic disks are not fully supported during setup.

Windows 2000 and Windows Server 2003 support basic disks, as well as conversion from basic disks to dynamic disks. However, the conversion has some caveats, and in general it is best to back up all data to a secondary medium, delete all data and partitions from a disk, convert the "empty" disk to a dynamic disk, reorganize the disk, and restore the data. If one simply converts a basic disk to a dynamic disk, not all of the benefits of a dynamic disk may be available; for example, one may not be able to dynamically resize the (soft) partitions on a dynamic disk, if it is a dynamic disk upgraded from a basic disk rather than a freshly created dynamic disk.


   
Top


Inside Windows Storage
Inside Windows Storage: Server Storage Technologies for Windows 2000, Windows Server 2003 and Beyond
ISBN: 032112698X
EAN: 2147483647
Year: 2003
Pages: 111
Authors: Dilip C. Naik

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