On 09/12/2024 00:14, Michael Stone wrote:
Not all drives
support 4k, and many that do get no benefit from such a configuration.
[...]
# nvme id-ns -H /dev/nvme0n1 | grep Rel
LBA Format 0 : Metadata Size: 0 bytes - Data Size: 512 bytes -
Relative Performance: 0x2 Good (in use)
LBA Format 1 : Metadata Size: 0 bytes - Data Size: 4096 bytes -
Relative Performance: 0x1 Better
It is my case. I decided that ext4 uses 4k blocks anyway, so it is
better to be consistent with hardware&firmware developers.
As to erase block size, my expectation is that some drivers might
benefit if that size is known: flushing caches (especially in laptop
mode), allocating space for new files. I have no evidences that it is
implemented though. Perhaps dedicated chips and caches inside drives may
do it more efficiently (besides dumb cheap models).
mkfs.* tools might use erase block size to align filesystem structures.
It is the reason why I was surprised that erase block size is not
exposed to kernel.
My real curiosity was caused by "not mounting" a drive to allow self
healing. "Idle" is imprecise from my point of view, but I think we may
stop here. There is a chance that I will accidentally notice a detailed
article on this topic.