3

After cleaning my hard disk, I created some new partitions using DiskPart, but there is a parameter called "Offset". I have read about it on internet , but there is a little information available about it, and I wasn't able to understand what it actually means and what's used for.

I created a 4th partition of size 105 GB, but it is showing an offset of 127 GB, is it okay ?

I have attached a photo of DiskPart showing offset size

Algeriassic
  • 1,719
  • 11
  • 10

2 Answers2

7

The offset is where your new partition starts from.

How 127 GB was calculated?

Notice the offset of each partition is the sum of: the size of the precedent partition and the last offset. (The first partition starts at 1024KB = 1MB).

The first offset is 1024KB (1MB).

  • The first partition has a size of 100MB. The second partition's offset is 101MB (100MB + 1MB).

  • The second partition's size is 29GB. The offset for the 3rd partition is 29GB + 101MB which is still 29GB (29.1 GB actually)

  • The 3rd partition's size is 97GB. The next (4th) partition will have an offset of 29.1GB + 97GB = ~127GB

  • The next partition, if you decide to create a new one, will start from 127GB + 105GB = 232 GB

Algeriassic
  • 1,719
  • 11
  • 10
0

I want to provide a comprehensive response by covering the following information:

  1. Understanding partition size and offset
  2. Determine offset parameter in diskpart

1. Understanding partition size and offset

Here is an example of list partition command:

DISKPART> list part

Partition ### Type Size Offset


Partition 1 Primary 100 MB 1024 KB Partition 2 Unknown 16 MB 101 MB Partition 3 Unknown 389 GB 117 MB Partition 4 Primary 782 MB 829 GB

Here is how it looks in Windows Disk Management utility: Windows Disk Management - Before

Try to visually match partitions based on their size. Note that the unallocated space is not listed as partition.

2. Determine offset parameter in diskpart

The diskpart utility requires specifying the offset parameter in KB. This makes list partition command insufficient to determine the exact value of the end offset for an existing partition. However, this value can be calculated for the selected partition with detail partition command:

DISKPART> detail part

Partition 4 Type : ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 Hidden : No Required: No Attrib : 0000000000000000 Offset in Bytes: 890469613568

Volume ### Ltr Label Fs Type Size Status Info


  • Volume 5 F Windows RE NTFS Partition 782 MB Healthy

Now, we need to do a little bit of math. Fortunately, we can use tools :)
Convert MB to/from KB
Convert KB to/from byte

Here is how to calculate the value for the above example:

  1. Convert start offset value to KB: 890469613568B = 869599232KB
  2. Convert existing partition size to KB: 782MB = 800768KB
  3. Add the two to determine the end offset value in KB: 870400000KB
  4. Create a new partition and specify its size, for example 1000MB.

Here is the command: create partition primary size=1000 offset=870400000

The result is the following: Windows Disk Management - After

Note that the partition size is specified in MB, while the offset is in KB.

MatrixRonny
  • 103
  • 3