0

Let's assume you use a new drive as a secondary drive in you PC and plan to store only your data there. (In my case, it's %USERS% of Windows and /home of Linux. The programs and system will be left on the primary drive, which we don't consider in this question.) Let's further assume that you use GPT as the partitioning scheme. However, apparently, gdisk won't allow you to use all the space:

Command (? for help): n
Partition number (1-128, default 1): 
First sector (34-1000204287, default = 2048) or {+-}size{KMGTP}: 34
Information: Moved requested sector from 34 to 2048 in
order to align on 2048-sector boundaries.
Use 'l' on the experts' menu to adjust alignment

AFAIK, leaving 2014 = 2048-34 sectors is useful if you plan to boot from this drive and place some boot code before the first partition. But you plan to have a secondary, data-only drive; you never boot from it. There might be moreover some performance degradation or additional wear. But then you better align your write accesses to 4 KiB or 512 KiB boundaries, and whether very beginning of the filesystem itself is aligned to 1 MiB (= 2048 sectors * 512 bytes/sector) boundaries or not, doesn't play that much of the role.

So, what goes wrong if you override this limitation and start your partition (with, say, NTFS or ext4) at sector 34?

0

But then you better align your write accesses to 4 KiB or 512 KiB boundaries, and

No. You can't your align your write access on the file level of an operating system. Once you formated a single partition on your data drive you copy files on it using the operating system. At that stage you do not have means of aligning your write access.

whether very beginning of the filesystem itself is aligned to 1 MiB (= 2048 sectors * > 512 bytes/sector) boundaries or not, doesn't play that much of the role.

Of course it does. As it's a whole-number multiple of today's physical sector size, the clusters of the filesystem will be aligned to the physical sectors.

So, what goes wrong if you override this limitation and start your partition (with, say, NTFS or ext4) at sector 34?

Technically that should work but it comes at a cost.

With a modern drive using physical sectors of 4096 byte while emulating logical sectors of 512 bytes the address 34*512 is not a whole-number multiple of 4096. When dealing with drives in a 512/4096 configuration, you should align the partitions to multiples of 8. Therefore 32 or 40 are the neighbouring good choices of your bad selection of 34.

Otherwise you are suffering avoidable wear on the drive because each write operation has to be preceded by a read operation.

Example for your particular case

3333333333444444444 logical 512 byte sector number (tenths)

0123456789012345678 logical 512 byte sector number (ones)

3344444444555555555 phyiscal 4096 byte sector number

What happens if you want to write the first cluster of your partition to sector 34? With a typical NTFS cluster being 4096 bytes, the operating system requests the drive to write 8 consecutive sectors of 512 byte, from 34 to 41. As you can see above, sector 34 until 39 belong to physical sector 4. Sector 40 and 41 however, belong to physical sector 5.

As the drive can internally only write the physical sector 4 which contains the sectors 32-40, it has to read that sector because it contains information of the logical sectors 32 and 33 which you do not overwrite. Only now after buffering the previous content the drive can overwrite the physical sector 5.

The same applies to the end of physical sector 5 - it has to be read and buffered before being partly overwritten at its beginning with the content of the logical sectors 40 and 41.

To verify the operation of your data drive, use h2testw on a windows machine or f3 on a linux machine.

| improve this answer | |
-1

The following excerpt from man gdisk explains the reason quite well:

Disks with more logical sectors per physical sectors (such as mod‐ ern Advanced Format drives), some RAID configurations, and many SSD devices, can suffer performance problems if partitions are not aligned properly for their internal data structures. On new disks, GPT fdisk attempts to align partitions on 1 MiB boundaries (2048-sectors on disks with 512-byte sectors) by default, which optimizes performance for all of these disk types. On pre-partitioned disks, GPT fdisk attempts to identify the alignment value used on that disk, but will set 8-sector alignment on disks larger than 300 GB even if lesser alignment values are detected.

| improve this answer | |
  • I downvoted this answer because it does not respond to the specific question refering to a partition start a sector 34. – r2d3 May 24 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy