4

I have a Intel Optane P4801X. It is a NVMe storage device.

In Linux, the physical sector size reported is 512 bytes:

$ sgdisk -p /dev/nvme0n1
Disk /dev/nvme0n1: 195371568 sectors, 93.2 GiB
Model: INTEL SSDPEL1K100GA
Sector size (logical/physical): 512/512 bytes

In Windows, the physical sector size reported is 4096 bytes:

PS c:\> get-disk | select model,LogicalSectorSize,PhysicalSectorSize

model LogicalSectorSize PhysicalSectorSize


INTEL SSDPEL1K100GA 512 4096

I am confusing, which one is correct?

I do notice an output from smartctl -x:

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         2
 1 -     512       8         2
 2 -     512      16         2
 3 -    4096       0         0
 4 -    4096       8         0
 5 -    4096      64         0
 6 -    4096     128         0

2 Answers2

1

The Intel article How to Change the Logical Sector Size in NVMe Drives says very little:

Generic IntelĀ® NVMe SSDs support only traditional 512B and 4096B sector sizes.

A method of finding out (and changing) the LBA Format is shown in the article How to change Intel Optane P4800X sector size. I assume that this disk is a close cousin to your model.

The article says:

The LBA Format for this drive is sub-optimal out of the factory. If you run:

nvme id-ns -H /dev/nvme1n1

It will show you:

LBA Format  0 : Metadata Size: 0   bytes - Data Size: 512 bytes - Relative Performance: 0x2 Good (in use)
LBA Format  1 : Metadata Size: 8   bytes - Data Size: 512 bytes - Relative Performance: 0x2 Good 
LBA Format  2 : Metadata Size: 16  bytes - Data Size: 512 bytes - Relative Performance: 0x2 Good 
LBA Format  3 : Metadata Size: 0   bytes - Data Size: 4096 bytes - Relative Performance: 0 Best 
LBA Format  4 : Metadata Size: 8   bytes - Data Size: 4096 bytes - Relative Performance: 0 Best 
LBA Format  5 : Metadata Size: 64  bytes - Data Size: 4096 bytes - Relative Performance: 0 Best 
LBA Format  6 : Metadata Size: 128 bytes - Data Size: 4096 bytes - Relative Performance: 0 Best

The above first three formats are less efficient. Note that changing the format will most likely require re-formatting the disk.

The article deals with the Linux version of the tools. It's possible that they will work in WSL (although perhaps better in WSL1 than WSL2), but the Windows version could perhaps be found in Intel Solid State Drive Tools.

Running the nvme tool, you might be able to find out the LBA Format advertised by the disk, and change it, if it's not one of the formats listed as "best".

As this is an SSD, I would assume that the real physical sector size is 4K, but that also both 512 and 4096 will work. However, if the operating system is unaware of the real physical sector size, it will work less efficiently with the disk.

harrymc
  • 498,455
0

Your drive most probably is 512e format, like most drives produced today :

512e is the advanced format in which the physical sector size is 4,096 bytes, but the logical sector size emulates 512 bytes sector size. The purpose of 512e is for the new devices to be used with OSs that do not support 4Kn sectors yet. However, inherently, 512-byte emulation involves a read-modify-write process in the device firmware for every write operation that is not 4KB aligned.

source

It looks like Windows is able to detect this and will report the true physical sector size, and won't give you other options than what it deems the best for your drive, while linux "trusts" the drives firmware. Or maybe linux wants to give you the option to use your drive in 512b mode and assumes you have enough expertise to evaluate the cosequences.

1NN
  • 10,044