When using an enterprise U.2/U.3 NVMe the sector size might be set to 520b (520 bytes) which doesn't work with default Linux/Windows installation or use. The sector size must be changed to either 512b or 4096b, which most standard NVMe and OS support.

Connect the drives and boot into an existing OS or liveCD with "nvme-cli" utility installed.

Run id-ns for each drive:

nvme id-ns /dev/nvme0n1
nvme id-ns /dev/nvme1n1

You'll see lbaf lines near the bottom like this:

lbaf  0 : ms:0   lbads:9  rp:0x2 (in use)
lbaf  1 : ms:0   lbads:12 rp:0x1

In this example our drive is already using 512b sector size which is "lbads:9" but an existing un-formatted drive with a 520b sector should also show as "lbads:9". From above, "lbads:9" means 512b size.

lbaf 0: This corresponds to 512-byte sectors (since lbads:9 means 2^9 = 512).
lbaf 1: This corresponds to 4096-byte sectors (since lbads:12 means 2^12 = 4096).

If you want to format the drive(s) to another sector size listed in the is-ns output run the following format command:

nvme format /dev/nvme0n1 --lbaf=0

For example "--lbad=0" would be 512b in this example, since in the "nvme id-ns /dev/nvme0n1" output the "lbad 0" line is corresponding to "lbads:9" which is 512b. If you'd want to change sector size to 4096b you would run "nvme format /dev/nvme0n1 --lbaf=1" in this example. Formatting an unused 520b sector drive to 512b on a linux OS would be the command referenced above.

Formatting to change sector size of course wiped all data on the drives.

Was this answer helpful? 0 Users Found This Useful (0 Votes)