Windows: Creating an aligned GPT partition by using diskpart

To create a 1GB partition on an empty GPT disk:
C:\>diskpart
Microsoft DiskPart version 5.1.3565

Copyright (C) 1999-2003 Microsoft Corporation.
On computer: NNII0280

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>
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.

    You can see the address of the first four GUID partition table entries. The new partition definition starts at offset 0×0080 in this block. The offset to the user partition is 0×0000000000010080 (65664.), which is a multiple of 128 and therefore aligned for performance purposes.
    The length of the partition is 0×0000000000210021 minus 0×0000000000010080 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 0×0000000000210022.
    The value 0×0000000000210022 (2,162,722) divided by 1024 leaves a remainder of 34.

    Creating a second aligned GPT partition by using diskpart

    To create a second 2 GB partition:

    C:\>diskpart

    Microsoft DiskPart version 5.1.3565

    Copyright (C) 1999-2003 Microsoft Corporation.
    On computer: NNII0280
    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>

    After formatting, the partition table entry contains the following:

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

    Incoming search terms:

    • GPT partition table
    • gpt align
    • align gpt partition
    • using diskpart to create gpt partition
    • san align gpt
    • gpt disk alignment
    • gpt create partitions 64k aligned
    • diskpart gpt
    • diskpart create gpt partition
    • create gpt gpt disk using diskpart
    This entry was posted in Uncategorized. Bookmark the permalink.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *


    8 + = fifteen

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>