I have a new 4 TB Western Digital SN850X NVMe SSD drive that I am trying to partition as a boot drive for Ubuntu 20.04. No matter what I do, fdisk reports that the partitions are misaligned, even though they appear to be aligned to both the logical (512 byte) and physical (8388608 byte) sector sizes:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model:
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 8388608 bytes
I/O size (minimum/optimal): 8388608 bytes / 8388608 bytes
Alignment offset: 6832128 bytes
Disklabel type: gpt
Device Start End Sectors Size Type
/dev/sda1 16384 671743 655360 320M EFI System
/dev/sda2 671744 7814035455 7813363712 3.7T Linux filesystem
Partition 1 does not start on physical sector boundary.
Partition 2 does not start on physical sector boundary.
Note that partition 1 starts at sector 16384, exactly 8 MiB (16384 * 512) into the disk, which matches the physical sector size, but fdisk claims that it's misaligned by the strange value of 6832128 bytes.
parted align-check
reports the same:
(parted) align-check
alignment type(min/opt) [optimal]/minimal? minimal
Partition number? 1
1 not aligned: 16384s % 16384s != 13344s
(parted) align-check
alignment type(min/opt) [optimal]/minimal? minimal
Partition number? 2
2 not aligned: 671744s % 16384s != 13344s
Here parted appears to be saying that the partitions are misaligned by 13344 sectors, which is 6832128 bytes, the same value reported by fdisk. But clearly "16384s % 16384s" is aligned.
Where is this bizarre misalignment value of 6832128 bytes / 13344 sectors coming from? Any suggestions / thoughts much appreciated!
head /sys/block/sda/*align* /sys/block/sda/queue/*size*
(written from memory, list may be incomplete) It's not uncommon for these values to be reported wrong. Personally I ignore this altogether and just stick to plain old MiB alignment. Is there an USB enclosure involved? All the more reason to ignore it as they tend to report wrong values, too.