Thursday 13 August 2015

Disk Devices and Partitions

A hard disk consists of a set of stacked platters, each of which has data stored electromagnetically in concentric circles, or tracks. Each platter has two heads, one on each side of the platter, that reads or writes data as the disk spins. A hard disk drive controls the positioning, reading, and writing of the hard disk. Note that the heads of all platters are positioned as a unit.
The smallest addressable unit of a track is a sector. A cylinder is defined as the set of tracks that appear in the same location on each platter. For example, the following diagram shows a hard disk with four platters. Cylinder X consists of eight tracks (track X from each side of each platter).
Hard disk, including tracks, sectors, and platters
A hard disk can contain one or more logical regions called partitions. Partitions are created when the user formats a hard disk as a basic disk. Windows also supports dynamic disks, which are not discussed in this topic. For more information about basic disks and dynamic disks, see Basic and Dynamic Disks.
The creation of multiple partitions on a disk allows the appearance of having separate hard drives. For example, a system with one hard disk that has one partition contains a single volume, designated by the system as drive C. A system with a hard disk with two partitions typically contains drives C and D. Having multiple partitions on a hard disk can make it easier to manage the system, for example to organize files or to support multiple users.
The first physical sector on a basic disk contains a data structure known as the Master Boot Record (MBR). The MBR contains the following:
  • A boot program (up to 442 bytes in size)
  • A disk signature (a unique 4-byte number)
  • A partition table (up to four entries)
  • An end-of-MBR marker (always 0x55AA)

Basic and Dynamic Disks

Before partitioning a drive or getting information about the partition layout of a drive, you must first understand the features and limitations of basic and dynamic disk storage types.
For the purposes of this topic, the term volume is used to refer to the concept of a disk partition formatted with a valid file system, most commonly NTFS, that is used by the Windows operating system to store files. A volume has a Win32 path name, can be enumerated by the FindFirstVolume and FindNextVolume functions, and usually has a drive letter assigned to it, such as C:. For more information about volumes and file systems, see File Systems.
In this topic:
There are two types of disks when referring to storage types in this context: basic disks and dynamic disks. Note that the storage types discussed here are not the same as physical disks or partition styles, which are related but separate concepts. For example, referring to a basic disk does not imply a particular partition style—the partition style used for the disk under discussion would also need to be specified. For a simplified description of how a basic disk storage type relates to a physical hard disk, see Disk Devices and Partitions.

Basic Disks

Basic disks are the storage types most often used with Windows. The term basic disk refers to a disk that contains partitions, such as primary partitions and logical drives, and these in turn are usually formatted with a file system to become a volume for file storage. Basic disks provide a simple storage solution that can accommodate a useful array of changing storage requirement scenarios. Basic disks also support clustered disks, Institute of Electrical and Electronics Engineers (IEEE) 1394 disks, and universal serial bus (USB) removable drives. For backward compatibility, basic disks usually use the same Master Boot Record (MBR) partition style as the disks used by the Microsoft MS-DOS operating system and all versions of Windows but can also support GUID Partition Table (GPT) partitions on systems that support it. For more information about MBR and GPT partition styles, see the Partition Styles section.
You can add more space to existing primary partitions and logical drives by extending them into adjacent, contiguous unallocated space on the same disk. To extend a basic volume, it must be formatted with the NTFS file system. You can extend a logical drive within contiguous free space in the extended partition that contains it. If you extend a logical drive beyond the free space available in the extended partition, the extended partition grows to contain the logical drive as long as the extended partition is followed by contiguous unallocated space. For more information, see How Basic Disks and Volumes Work.
The following operations can be performed only on basic disks:
  • Create and delete primary and extended partitions.
  • Create and delete logical drives within an extended partition.
  • Format a partition and mark it as active.

Dynamic Disks

Dynamic disks provide features that basic disks do not, such as the ability to create volumes that span multiple disks (spanned and striped volumes) and the ability to create fault-tolerant volumes (mirrored and RAID-5 volumes). Like basic disks, dynamic disks can use the MBR or GPT partition styles on systems that support both. All volumes on dynamic disks are known as dynamic volumes. Dynamic disks offer greater flexibility for volume management because they use a database to track information about dynamic volumes on the disk and about other dynamic disks in the computer. Because each dynamic disk in a computer stores a replica of the dynamic disk database, for example, a corrupted dynamic disk database can repair one dynamic disk by using the database on another dynamic disk. The location of the database is determined by the partition style of the disk. On MBR partitions, the database is contained in the last 1 megabyte (MB) of the disk. On GPT partitions, the database is contained in a 1-MB reserved (hidden) partition.
Dynamic disks are a separate form of volume management that allows volumes to have noncontiguous extents on one or more physical disks. Dynamic disks and volumes rely on the Logical Disk Manager (LDM) and Virtual Disk Service (VDS) and their associated features. These features enable you to perform tasks such as converting basic disks into dynamic disks, and creating fault-tolerant volumes. To encourage the use of dynamic disks, multi-partition volume support was removed from basic disks, and is now exclusively supported on dynamic disks.
The following operations can be performed only on dynamic disks:
  • Create and delete simple, spanned, striped, mirrored, and RAID-5 volumes.
  • Extend a simple or spanned volume.
  • Remove a mirror from a mirrored volume or break the mirrored volume into two volumes.
  • Repair mirrored or RAID-5 volumes.
  • Reactivate a missing or offline disk.
Another difference between basic and dynamic disks is that dynamic disk volumes can be composed of a set of noncontiguous extents on one or multiple physical disks. By contrast, a volume on a basic disk consists of one set of contiguous extents on a single disk. Because of the location and size of the disk space needed by the LDM database, Windows cannot convert a basic disk to a dynamic disk unless there is at least 1 MB of unused space on the disk.
Regardless of whether the dynamic disks on a system use the MBR or GPT partition style, you can create up to 2,000 dynamic volumes on a system, although the recommended number of dynamic volumes is 32 or less. For details and other considerations about using dynamic disks and volumes, see Dynamic disks and volumes.
For more features of and usage scenarios for dynamic disks, see What Are Dynamic Disks and Volumes?.
The operations common to basic and dynamic disks are the following:
  • Support both MBR and GPT partition styles.
  • Check disk properties, such as capacity, available free space, and current status.
  • View partition properties, such as offset, length, type, and if the partition can be used as the system volume at boot.
  • View volume properties, such as size, drive-letter assignment, label, type, Win32 path name, partition type, and file system.
  • Establish drive-letter assignments for disk volumes or partitions, and for CD-ROM devices.
  • Convert a basic disk to a dynamic disk, or a dynamic disk to a basic disk.
Unless specified otherwise, Windows initially partitions a drive as a basic disk by default. You must explicitly convert a basic disk to a dynamic disk. However, there are disk space considerations that must be accounted for before you attempt to do this. For more information, see How To Convert to Basic and Dynamic Disks in Windows XP Professional.

Partition Styles

Partition styles, also sometimes called partition schemes, is a term that refers to the particular underlying structure of the disk layout and how the partitioning is actually arranged, what the capabilities are, and also what the limitations are. To boot Windows, the BIOS implementations in x86-based and x64-based computers require a basic disk that must contain at least one master boot record (MBR) partition marked as active where information about the Windows operating system (but not necessarily the entire operating system installation) and where information about the partitions on the disk are stored. This information is placed in separate places, and these two places may be located in separate partitions or in a single partition. All other physical disk storage can be set up as various combinations of the two available partition styles, described in the following sections. For more information about other system types, see the TechNet topic on partition styles.
Dynamic disks follow slightly different usage scenarios, as previously outlined, and the way they utilize the two partition styles is affected by that usage. Because dynamic disks are not generally used to contain system boot volumes, this discussion is simplified to exclude special-case scenarios. For more detailed information about partition data block layouts, and basic or dynamic disk usage scenarios related to partition styles, see How Basic Disks and Volumes Workand How Dynamic Disks and Volumes Work.

Master Boot Record

All x86-based and x64-based computers running Windows can use the partition style known as master boot record(MBR). The MBR partition style contains a partition table that describes where the partitions are located on the disk. Because MBR is the only partition style available on x86-based computers prior to Windows Server 2003 with Service Pack 1 (SP1), you do not need to choose this style. It is used automatically.
You can create up to four partitions on a basic disk using the MBR partition scheme: either four primary partitions, or three primary and one extended. The extended partition can contain one or more logical drives. The following figure illustrates an example layout of three primary partitions and one extended partition on a basic disk using MBR. The extended partition contains four extended logical drives within it. The extended partition may or may not be located at the end of the disk, but it is always a single contiguous space for logical drives 1-n.
Three primary partitions and one extended partition on a basic disk using MBR
Each partition, whether primary or extended, can be formatted to be a Windows volume, with a one-to-one correlation of volume-to-partition. In other words, a single partition cannot contain more than a single volume. In this example, there would be a total of seven volumes available to Windows for file storage. An unformatted partition is not available for file storage in Windows.
The dynamic disk MBR layout looks very similar to the basic disk MBR layout, except that only one primary partition is allowed (referred to as the LDM partition), no extended partitioning is allowed, and there is a hidden partition at the end of the disk for the LDM database. For more information on the LDM, see the Dynamic Disks section.

GUID Partition Table

Systems running Windows Server 2003 with SP1 and later can use a partition style known as the globally unique identifier (GUID) partition table (GPT) in addition to the MBR partition style. A basic disk using the GPT partition style can have up to 128 primary partitions, while dynamic disks will have a single LDM partition as with MBR partitioning. Because basic disks using GPT partitioning do not limit you to four partitions, you do not need to create extended partitions or logical drives.
The GPT partition style also has the following properties:
  • Allows partitions larger than 2 terabytes.
  • Added reliability from replication and cyclic redundancy check (CRC) protection of the partition table.
  • Support for additional partition type GUIDs defined by original equipment manufacturers (OEMs), independent software vendors (ISVs), and other operating systems.
The GPT partitioning layout for a basic disk is illustrated in the following figure.
GPT layout
The protective MBR area exists on a GPT partition layout for backward compatibility with disk management utilities that operate on MBR. The GPT header defines the range of logical block addresses that are usable by partition entries. The GPT header also defines its location on the disk, its GUID, and a 32-bit cyclic redundancy check (CRC32) checksum that is used to verify the integrity of the GPT header. Each GUID partition entry begins with a partition type GUID. The 16-byte partition type GUID, which is similar to a System ID in the partition table of an MBR disk, identifies the type of data that the partition contains and identifies how the partition is used, for example if it is a basic disk or a dynamic disk. Note that each GUID partition entry has a backup copy.
Dynamic disk GPT partition layouts looks similar to this basic disk example, but as stated previously have only one LDM partition entry rather than 1-n primary partitions as allowed on basic disks. There is also a hidden LDM database partition with a corresponding GUID partition entry for it. For more information on the LDM, see the Dynamic Disks section.

Detecting the Type of Disk

There is no specific function to programmatically detect the type of disk a particular file or directory is located on. There is an indirect method.
First, call GetVolumePathName. Then, call CreateFile to open the volume using the path. Next, useIOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS with the volume handle to obtain the disk number and use the disk number to construct the disk path, such as "\\?\PhysicalDriveX". Finally, use IOCTL_DISK_GET_DRIVE_LAYOUT_EX to obtain the partition list, and check the PartitionType for each entry in the partition list.

Primary partition VS logical drive

As known to many users, a brand new hard disk can not be used until users divide it into 1 or more chunks which are called hard disk partitions. There are 3 types of hard disk partitions, namely primary partition, extended partition, and logical drive. Users can get detailed information about each partition from Windows built-in Computer/Disk Management: 



From the interface above we can see partition C and partition E are primary partitions and partition F and Partition G are logical drives. Next, let's get to know features of these 2 types of hard disk partitions. 

Primary Partition VS Logical Drive 

Primary partition is the very hard disk partition which can be used to install Windows operating system, and only one primary partition can be set as active to boot operating system at a time. It is created by using unallocated space rather than free space. On a MBR disk, there can only be 4 primary partitions or 3 primary partitions and 1 extended partition at most. 

Logical Drive is the very volume that resides in extended partition. Extended partition can not be used to store data directly unless users partition it to logical drives. A hard disk drive can contain the maximum of 1 extended partition, but the extended partition can be divided into multiple logical drives. Nevertheless, logical drive can not be used to install Windows operating systems. 

Now, users would get a basic understanding of primary partition and logical drive. Different partition type has its own advantages and disadvantages, so users need to convert partition type between primary and logical in specified situations. For example, if users want to create more partitions on a MBR disk when there have been 4 primary partitions, they need to set one of primary partitions as logical (note: boot partition is not allowed); if users want to install another Windows operating system but there is no primary partition available, they can set one of logical drives as primary. 

How to Change Partition Type 

Users can turn to Windows built-in Disk Management to complete some basic partition operations, like create partition, delete partition, and format partition. But to change partition type, they had better ask third-party partition manager for help, because this tool does not provide such a function. Here, we suggest using MiniTool Partition Wizard to convert partition type. It is able to set partition as logical or set partition as primary in one step and without data loss. Specific operations are as follows: right click the target partition and choose "Set Partition as Logical" or "Set Partition as Primary" from the submenu of "Modify". At last, click "Apply" button in toolbar to apply changes to computer. After application, the work to change partition type is finished completely.

 

Knowing features of primary partition and logical drive is good for computer use, and users can change partition type reasonably to meet actual demands. 

Change a Dynamic Disk Back to a Basic Disk

Basic disks support only primary partitions, extended partitions, and logical drives. Basic disks have been supported in operating systems since MS-DOS, while dynamic disks have been supported in operating systems since Windows 2000.
Backup Operators or Administrator is the minimum membership required.

To change a dynamic disk back to a basic disk using the Windows interface
  1. Back up all volumes on the disk you want to convert from dynamic to basic.
  2. In Disk Management, right-click each volume on the dynamic disk you want to convert to a basic disk, and then click Delete Volume for each volume on the disk.
  3. When all volumes on the disk have been deleted, right-click the disk, and then click Convert to Basic Disk.

Additional considerations

  • The disk must not have any volumes nor contain any data before you can change it back to a basic disk. If you want to keep your data, back it up or move it to another volume before you convert the disk to a basic disk.
  • Once you change a dynamic disk back to a basic disk, you can create only partitions and logical drives on that disk.




To change a dynamic disk back to a basic disk using a command line
  1. Back up all volumes on the disk you want to convert from dynamic to basic.
  2. Open a command prompt and type diskpart.
  3. At the DISKPART prompt, type list disk. Make note of the disk number you want to convert to basic.
  4. At the DISKPART prompt, type select disk <disknumber>.
  5. At the DISKPART prompt, type detail disk <disknumber>.
  6. For each volume on the disk, at the DISKPART prompt, type select volume= <volumenumber> and then type delete volume.
  7. At the DISKPART prompt, type select disk <disknumber>. Specify the disk number of the disk that you want to convert to a basic disk.
  8. At the DISKPART prompt, type convert basic.

 

ValueDescription
list disk
Displays a list of disks and information about them, such as their size, amount of available free space, whether the disk is a basic or dynamic disk, and whether the disk uses the master boot record (MBR) or GUID partition table (GPT) partition style. The disk marked with an asterisk (*) has focus.
select diskdisknumber
Selects the specified disk, where disknumber is the disk number, and gives it focus.
detail diskdisknumber
Displays the properties of the selected disk and the volumes on that disk.
select volumedisknumber
Selects the specified volume, where disknumber is the volume number, and gives it focus. If no volume is specified, the select command lists the current volume with focus. You can specify the volume by number, drive letter, or mount point path. On a basic disk, selecting a volume also gives the corresponding partition focus.
delete volume
Deletes the selected volume. You cannot delete the system volume, boot volume, or any volume that contains the active paging file or crash dump (memory dump).
convert basic
Converts an empty dynamic disk into a basic disk.

Additional considerations

  • The disk must not have any volumes or contain any data before you can change it back to a basic disk. If you want to keep your data, back it up or move it to another volume before you convert the disk to a basic disk.
  • Once you change a dynamic disk back to a basic disk, you can create only partitions and logical drives on that disk.

Additional references

Bitlocker in Windows 10 without TPM

How to Configure Computer to Enable BitLocker without Compatible TPM:


Administrators must follow the steps below to configure their Windows 8 computers to allow enabling Bit Locker Drive Encryption without compatible TPM:


a. Log on to Windows 10 computer with the account that has administrative privileges.

b. Assuming that the computer has been configured to display classic start menu, click Start and at the bottom of the menu in search box type GPEDIT.MSC command and press enter key.

c. On the opened Local Group Policy Editor snap-in from the left pane expand Computer Configuration >Administrative Templates > Windows Components > Bit Locker Drive Encryption and from the expanded list click to select Operating System Devices.

d. From the right pane double-click “Require additional authentication” at startup.

e. On the opened box click to select Enabled radio button and ensure that under Options section Allow Bit Locker without a compatible TPM checkbox is checked. 

f. Once done, click Ok button to allow the changes to take effect and close Local Group Policy Editor snap-in.