You are not logged in.
Going through the Arch Linux Installation guide, under section 1.9 Partition the disks there is a tip: "Check that your NVMe drives and Advanced Format hard disk drives are using the optimal logical sector size before partitioning."
However going through the referenced article I'm being told that SSDs typically do not report their physical sector size, but report their logical sector size instead. There is also a block on the page stating that the factual accuracy of the article is disputed, because "Neither of the commands below [...] will accurately provide the physical sector size on NVMe drives (probably all SSDs), and will report the logical sector size instead.".
Section 1.2 NVMe solid state drives then describes how to "check the formatted logical block address size (FLBAS)" of my NVMe SSD using the nvme command. The command lists different block sizes and judges their "Relative Performance".
I'm quite confused now as to whether it is possible to figure out the physical sector size and how I would do that. If it's not possible is the recommended way to use the nvme utility to list the different block sizes and then choose the one providing the best "relative performance"? How does the nvme tool figure out which size provides better performance and which provides worse? Does it run some read/write operations with different sector sizes and measures the differences in performance? And how does the concept of "formatted logical block address size" relate to the concepts of "logical sector size" and "physical sector size"? Is the FLBAS simply the logical sector size configured for the drive or is it something else?
Last edited by krnlpnc (2023-10-24 13:43:35)
Offline
Changing the LBA size from 512e (mostly emulated today) to advanced format (4kB) is possible, but not on all NVMe's.
I have changed it on my PC.My PC has two NVMe drives: One newer Samsung and one older Western Digital. The Samsung was not possible to change, the WD was possible. It depends it the Chip supports it (my WD blue NVMe has a Sandisk chip).
The advanced format id done by coding a bit of the drive firmware. It is not lost, wehen you formatting the drive with ext4.
Note: Changing to advanced format will erase everything on the drive. The drive must be formatted after changing with normal file system (ext4, luks, btrfs, reiserfs,..whatever you use/want)
First: Check what is LBA is currently used, and check if changing is possible. Check first your drive name with lsblk.
I will put here my commands, that you can compare it for your system:
My Samsung drive: (funny, the newer PCIe4 drive)
> nvme id-ns -H /dev/nvme1n1 | grep "Relative Performance"
LBA Format 0 : Metadata Size: 0 bytes - Data Size: 512 bytes - Relative Performance: 0 Best (in use)
Here on my my Samsung drive changing to advanced format is not possible/not supported.
My Western Digital drive: (funny the older PCIe3 drive)
> nvme id-ns -H /dev/nvme0n1 | grep "Relative Performance"
LBA Format 0 : Metadata Size: 0 bytes - Data Size: 512 bytes - Relative Performance: 0x2 Good
LBA Format 1 : Metadata Size: 0 bytes - Data Size: 4096 bytes - Relative Performance: 0x1 Better (in use)
On the Western Digital drive changing is possible and here it was already done. In the past the (in use) was one line above.
To change the LBA in the drive, that 4k/advanced format is used:
Note: With following command: Everything will be erased/deleted on the drive! Make backup before!!!
> nvme format --lbaf=1 /dev/nvmeXnY
Note: With prior command: Everything will be erased/deleted on the drive! Make backup before!!!
After changing the LBA coding of your drive, you can format it with your desired file system in normal way (gdisk, gparted,...).
Here some commands, which may be for interest for you:
smartctl -a /dev/nvmeXnY
lsblk -td
Hope this helps you,
regards, obelisk
Offline