You are on page 1of 12

Aligning GPT Basic and Dynamic Disks

For Microsoft Windows 2003

Technical Note
P/N 300-004-075 A01 August, 2006

This technical note describes how to align partitions on GUID Partition Table (GPT) disks for a Microsoft Windows 2003 platform. The following topics are covered: Introduction ................................................................................................ 2 Windows 2003 GPT disk layout............................................................... 3 How partitions are created on a GPT disk ............................................. 6 Creating an aligned GPT partition by using diskpart........................... 7 Creating a second aligned GPT partition by using diskpart................ 9 Aligning GPT dynamic volumes ........................................................... 11

Introduction

Introduction
Microsoft Windows 2003 introduced a new type of disk layout called GUID Partition Table (GPT) disks. This layout is designed to overcome some problems and deficiencies associated with the traditional master boot record (MBR) style disks. The advantages of GPT disks include: Partition size that can be up to 18 exabytes. A GPT disk can contain up to 128 partitions. Integrity of primary and backup partition tables that allows redundancy. Partition format that is well defined, fully self-identifying and accommodates future expansion with version number and size fields. Unique ID for each partition that prevents partition identifier collision. Initially, only the IA64 (Itanium) version of Windows 2003 supported GPT disks. An IA64 system cannot boot unless the boot disk is a GPT disk. With Service Pack 1, support was added to 32-bit versions of Windows 2003, but a GPT disk is still not supported as the boot disk.
Note: The next version of Windows (currently called Longhorn or Vista) is planned to have boot-from-GPT support for 32-bit processors.

This technical note applies only to Windows 2003 platforms. The United Extended Firmware Interface (UEFI) standard is a platform-neutral standard and any vendor can enforce restrictions that they see fit. For example, Windows GPT disks will always require a Microsoft Reserved (MSR) partition, but GPT disks created with Linux may not require it. GPT disks can have aligned partitions, but only if diskpart is used to create the partitions. Like MBR style disks, GPT disks can be either basic or dynamic. One of the important characteristics of GPT disks is that all the system areas are protected by CRC checksums, so it is virtually impossible to manipulate disks without the vendor-supplied tools. Currently for Windows, this means that only the following tools can be used: diskpart.exe diskmgmt.msc (the console GUI) diskpart.efi (the standalone version of diskpart that can be booted from an EFI partition)
Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

Windows 2003 GPT disk layout

Windows 2003 GPT disk layout


The only way to create a basic GPT disk is to convert an existing empty MBR disk. There can be no partitions or data on the disk. The Microsoft tools to convert the disk will not function if there are existing partitions. Once you have created a GPT disk, the layout is as follows:

Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

Windows 2003 GPT disk layout

LBA 0 Protective master boot record


The protective master boot record (MBR) provides downward compatibility so that systems prior to Windows 2003 do not inadvertently corrupt the disk. If a legacy system accesses a GPT disk, then the disk appears to have a single partition of type 0xEE which is unknown to the legacy system. There is still a disk signature and the MBR signature, but no boot code.
LBN 0 0x0000 ****** 0x01b0 0x01c0 0x01d0 0x01e0 0x01f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 EE 00 00 00 00 FF 00 00 00 00 FF 00 00 00 00 FF 00 00 00 00 01 00 00 00 00-1f 00-00 00-00 00-00 00-00 dd 00 00 00 00 b4 FF 00 00 00 f8 FF 00 00 00 00 FF 00 00 00 00 FF 00 00 00 00 00 00 00 55 00 00 00 00 aa

The signature is (0x01FDDB4F8). The single partition is defined as type 0xEE. The offset is always 0x00000001. The length is always 0xFFFFFFFF.

LBA 1 Primary GUID partition table header


The GUID partition table header is always at LBA 1 and indicates how many partitions can be defined for the disk. For Windows GPT disks, there can be 128 partitions, but the standard does not define a limit. This GUID header is also duplicated at the very end of the disk.
Note: All addresses in GPT disk structures are 64-bits long. LBN 1 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 ****** 0x01f0 45 bc ff de b0 80 00 46 91 ff ff a4 00 00 49 da ff ff 68 00 00 20 28 01 01 1d 00 00 50 00 00 00 94 80 00 41 00 00 00 f5 00 00 52 00 00 00 e7 00 00 54-00 00-01 00-22 00-da 33-02 00-75 00-00 00 00 00 28 00 68 00 01 00 00 ea 00 eb 00 00 00 00 37 00 a4 00 5c 00 00 9a 00 00 00 00 00 00 78 00 00 00 00 00 00 6a 00 00 00 00 00 00 4a 00 00 00 EFI PART....\... (............ ....."....... .....(7xjJ h3........ ......uh.... ................ ................

00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00

Note: The Microsoft 'secinspect' program has been used throughout this guide to display the contents of disk content.

Note the following fields:


4 Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

Windows 2003 GPT disk layout

Location of primary GUID partition table header (0x0000000000000001). Location of backup GUID partition table header (0x000000001FFFFFF). This is the address of the last block on the disk. First block available for allocating partitions is 34 (0x0000000000000022). The value (34) is determined by the fact that GPT disks can have 128 partitions, and each disk block can hold 4 partition definitions. The addition of the protective MBR and partition table header provides a total of 34. Maximum number of partitions for this disk is 128 (0x00000080).

LBA 2 Address of the first four GUID partition table entries


Each disk block can contain 4 partition definitions. LBA 2 will contain the first four partitions.
LBN 2 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 ****** 0x01f0 16 9c 22 00 6f 73 61 00 e3 0c 00 00 00 00 00 00 c9 37 00 00 73 65 72 00 e3 8a 00 00 00 00 00 00 5c 5c 00 00 6f 72 74 00 0b ec 00 00 00 00 00 00 b8 d7 00 00 66 76 69 00 4d-81 4d-bc 00-21 00-4d 00-74 00-65 00-74 00-00 7d 50 00 00 00 00 00 00 f9 ce 01 69 20 64 69 00 2d ac 00 00 00 00 00 00 f0 a0 00 63 72 20 6f 00 02 62 00 00 00 00 00 00 15 35 00 72 65 70 6e 00 ae fd 00 00 00 00 00 00 \.M}--. .7\MPb5 ".......!....... ........M.i.c.r. o.s.o.f.t. .r.e. s.e.r.v.e.d. .p. a.r.t.i.t.i.o.n. ................ ................

00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00

In this example, the only defined partition is a system partition (Microsoft reserved partition). It starts as block address 0x0000000000000022 and ends at 0x0000000000010021. In this particular case, the first user partition, by default, will start at block address 0x0000000000010022.

LBA 34 Address of the first partition (Microsoft reserved partition)


Converting an MBR disk to a GPT disk always creates at least one system type partition. The first partition will always start at block address 34. (0x22) and the length of the Microsoft reserved partition in every case will vary according to the size of the disk. Normally, one or two system partitions are created depending on whether this is a boot disk on an IA64 system. Either way, the address of the first user partition cannot be easily determined without first inspecting the partition table entry blocks.
Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note 5

How partitions are created on a GPT disk

Fortunately, diskpart automatically performs this action when a partition is created.


LBN 34 0x0000 ****** 0x01f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ ................

At this stage, the Microsoft reserved partition contains no data. If a partition is created at this stage by using diskpart (or the GUI), and by also using default options, the user partition would be created at offset 0x0000000000010022. This address is not aligned since the address is not divisible by 128. The only way to create a partition that is aligned is by using diskpart with the align option. The GUI offers no option for alignment.

How partitions are created on a GPT disk


When creating aligned partitions, it is useful to understand how the default creation of partitions on a GPT disk occurs. The first useable block for a partition is LBA 34 (0x22). When many partitions are created on a GPT disk, the layout can be visualized as follows:

All partitions are created in multiples of 1 MB (2048 Blocks). Since the first partition starts at LBA 34, all partitions start 34 blocks after a logical block address, which is a multiple of 2048. This means that all partitions created will be misaligned by 34 blocks. When partitions are aligned by using diskpart, we set the starting position of each partition to be a multiple of 128 blocks. Windows 2003 however, will always end the partition on a boundary as shown in preceding figure.

Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

Creating an aligned GPT partition by using diskpart

Use of diskpart to align a number of partitions results in the following:

Four aligned partitions were created with diskpart. Windows has ended these partitions at the same addresses as shown in the preceding misaligned example. This means that there is a gap between each of the partitions.

Creating an aligned GPT partition by using diskpart


To create a 1GB partition on an empty GPT disk:
C:\>diskpart Microsoft DiskPart version 5.2.3790.1830 Copyright (C) 1999-2001 Microsoft Corporation. On computer: W3KR2 DISKPART> Select Disk 1 Disk 1 is now the selected disk. DISKPART> create partition primary size=1024 align=64 DiskPart succeeded in creating the specified partition. DISKPART>

Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

Creating an aligned GPT partition by using diskpart

Note: The size is specified in megabytes.

The alignment is not an absolute address (as in diskpar), but is an alignment value to be applied to the next free block on the disk. The alignment is expressed in 1 KB increments instead of blocks. diskpar uses a block count and is the actual address of the partition to create. diskpart creates a partition at the next available block that is a multiple of 64 KB (128 Blocks). After formatting, the partition table entry appears as follows.
LBN 2 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 ****** 0x01ff 16 9c 22 00 6f 73 61 00 a2 e4 80 00 63 61 00 e3 0c 00 00 00 00 00 00 a0 fd 00 00 00 00 00 c9 37 00 00 73 65 72 00 d0 e7 01 00 20 72 00 e3 8a 00 00 00 00 00 00 eb d2 00 00 00 00 00 5c 5c 00 00 6f 72 74 00 e5 8a 00 00 64 74 00 0b ec 00 00 00 00 00 00 b9 f6 00 00 00 00 00 b8 d7 00 00 66 76 69 00 33 14 00 00 61 69 00 4d-81 4d-bc 00-21 00-4d 00-74 00-65 00-74 00-00 44-87 44-88 00-21 00-42 00-74 00-74 00-00 7d 50 00 00 00 00 00 00 c0 80 00 00 00 00 00 f9 ce 01 69 20 64 69 00 68 42 21 61 61 69 00 2d ac 00 00 00 00 00 00 b6 4e 00 00 00 00 00 f0 a0 00 63 72 20 6f 00 b7 e0 00 73 20 6f 00 02 62 00 00 00 00 00 00 26 e7 00 00 00 00 00 15 35 00 72 65 70 6e 00 99 8d 00 69 70 6e 00 ae fd 00 00 00 00 00 00 c7 86 00 00 00 00 00 \.M}--. .7\MPb5 ".......!....... ........M.i.c.r. o.s.o.f.t. .r.e. s.e.r.v.e.d. .p. a.r.t.i.t.i.o.n. ................ 3Dh& DBN .......! ...... ........B.a.s.i. c. .d.a.t.a. .p. a.r.t.i.t.i.o.n. ................ ................

00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00

You can see the address of the first four GUID partition table entries. The new partition definition starts at offset 0x0080 in this block. The offset to the user partition is 0x0000000000010080 (65664.), which is a multiple of 128 and therefore aligned for performance purposes. The length of the partition is 0x0000000000210021 minus 0x0000000000010080 plus 1. This value is 0x1FFFA2. This length is not quite the requested size. It is 0x5e (94) blocks short of the full 2 GB partition. What diskpart has done is round down the request to fit the rules for ending addresses on the boundary as shown in the preceding figure. By default, the next partition will be created at 0x0000000000210022. The value 0x0000000000210022 (2,162,722) divided by 1024 leaves a remainder of 34.

Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

Creating a second aligned GPT partition by using diskpart

Creating a second aligned GPT partition by using diskpart


To create a second 2 GB partition:
C:\>diskpart Microsoft DiskPart version 5.2.3790.1830 Copyright (C) 1999-2001 Microsoft Corporation. On computer: W3KR2 DISKPART> Select Disk 1 Disk 1 is now the selected disk. DISKPART> create partition primary size=2048 align=64 DiskPart succeeded in creating the specified partition. DISKPART>

Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

Creating a second aligned GPT partition by using diskpart

After formatting, the partition table entry contains the following:


LBN 2 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0 0x0100 0x0110 0x0120 0x0130 0x0140 0x0150 0x0160 ****** 0x01f0 [C 0, H 0, S 3] 16 1c 22 00 6f 73 61 00 a2 d6 80 00 63 61 00 00 a2 f0 80 00 63 61 00 e3 ca 00 00 00 00 00 00 a0 e4 00 00 00 00 00 00 a0 07 00 00 00 00 00 c9 7f 00 00 73 65 72 00 d0 00 01 00 20 72 00 00 d0 06 21 00 20 72 00 e3 c7 00 00 00 00 00 00 eb 50 00 00 00 00 00 00 eb 4e 00 00 00 00 00 5c da 00 00 6f 72 74 00 e5 af 00 00 64 74 00 00 e5 1d 00 00 64 74 00 0b 5e 00 00 00 00 00 00 b9 4d 00 00 00 00 00 00 b9 5d 00 00 00 00 00 b8 2e 00 00 66 76 69 00 33 1d 00 00 61 69 00 00 33 06 00 00 61 69 00 4d-81 43-b6 00-21 00-4d 00-74 00-65 00-74 00-00 44-87 4d-8a 00-21 80-42 00-74 00-74 00-00 00-00 44-87 4a-81 00-21 80-42 00-74 00-74 00-00 7d 6b 00 00 00 00 00 00 c0 2f 00 00 00 00 00 00 c0 cf 00 00 00 00 00 f9 ec 01 69 20 64 69 00 68 10 21 61 61 69 00 00 68 11 61 61 61 69 00 2d f5 00 00 00 00 00 00 b6 55 00 00 00 00 00 00 b6 7e 00 00 00 00 00 f0 15 00 63 72 20 6f 00 b7 9b 00 73 20 6f 00 00 b7 31 00 73 20 6f 00 02 36 00 00 00 00 00 00 26 b3 00 00 00 00 00 00 26 1c 00 00 00 00 00 15 fa 00 72 65 70 6e 00 99 70 00 69 70 6e 00 00 99 25 00 69 70 6e 00 ae 58 00 00 00 00 00 00 c7 f6 00 00 00 00 00 00 c7 95 00 00 00 00 00 \.M}--. ^.Ck6X ".......!....... ........M.i.c.r. o.s.o.f.t. .r.e. s.e.r.v.e.d. .p. a.r.t.i.t.i.o.n. ................ 3Dh& .PMM/Up .......!.!..... .......B.a.s.i. c. .d.a.t.a. .p. a.r.t.i.t.i.o.n. ................ ................ 3Dh& -..N].J~1% .!.....!.a..... .......B.a.s.i. c. .d.a.t.a. .p. a.r.t.i.t.i.o.n. ................ ................

00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00

The second partition actually starts at 0x000000000210080 which is aligned to 128. The first partition ended at 0x0000000000210021 and there is a gap between the two partitions.

Summary
You can use diskpart to align partitions on a Windows 2003 basic GPT disk as follows: 1. 2. 3. Ensure the disk is empty. Delete all volumes and partitions. Convert the MBR disk to a GPT disk. Using diskpart, create the appropriate partition size that is aligned at one of the following: 64 (128 blocks) if an EMC Symmetrix volume 64 (128 blocks) if an EMC CLARiiON LUN with default element size (optional) Create subsequent volumes that are aligned with diskpart by using the align option.

4.

10

Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

Aligning GPT dynamic volumes

Note: You cannot use the disk management GUI or diskpar to align partitions.

Aligning GPT dynamic volumes


You cannot align dynamic volumes on GPT disks unless they were present as aligned partitions when the disk was converted. You cannot create any volumes on a dynamic GPT disk that will be aligned. Creating a dynamic GPT partition is similar to creating a dynamic MBR disk. You can convert an empty GPT disk, or convert a GPT disk with existing partitions.

GPT dynamic disk created from an empty disk


Once a GPT disk has been converted to dynamic, there is no way to align a volume because there is no align option to the create volume command in diskpart. All volumes will be created at the same boundary as basic GPT disks (34 blocks after an alignment boundary).

GPT dynamic disk created from a non-empty disk


If a GPT disk contains existing partitions, those partitions are converted to dynamic simple volumes in place. Any alignment remains the same. This means that you could create aligned partitions when the disk was a basic disk and then convert the disk to dynamic. The resulting simple volumes would still be aligned. The problem is that you are restricted to this layout which means that you lose all of the dynamic volume management features. Limitations include: You cannot create any more volumes that will be aligned. You cannot extend the existing volumes without misaligning the additional subvolumes. You cannot create a mirror image that is aligned.

Summary
You cannot use diskpart to align partitions on a Windows 2003 dynamic GPT disk because the align option is not available. Any existing partitions will retain their alignment when the disk is converted.

Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

11

Aligning GPT dynamic volumes

Copyright 2006 EMC Corporation. All Rights Reserved. EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice. THE INFORMATION IN THIS PUBLICATION IS PROVIDED "AS IS." EMC CORPORATION MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLY DISCLAIMS IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Use, copying, and distribution of any EMC software described in this publication requires an applicable software license. For the most up-to-date listing of EMC product names, see EMC Corporation Trademarks on EMC.com. All other trademarks used herein are the property of their respective owners.

12

Aligning GPT Basic and Dynamic Disks For Microsoft Windows 2003 Technical Note

You might also like