You are not logged in.
All commands from https://wiki.archlinux.org/title/Advanced_Format
# nvme id-ns -H /dev/nvme0n1 | grep "Relative Performance"
# smartctl -c /dev/nvme0n1report I have block size 512b
as well as
# cryptsetup luksDump device | grep sectorreports
sector: 512 bytesfdisk -l also reporting block size 512 bytes
NVMe disk model SKHynix_HFS001TEJ4X112N
Last edited by webcapcha (2024-03-04 07:02:18)
Ukrainian
Offline
Changing sector size will lose you all data (or in case of LUKS, require re-encryption); unless you're running very performance critical applications, it's usually not worth the bother. Filesystem alignment is important, everything else is optional.
Performance issues with SSD/NVME are usually for other reasons outside of your control (cache issues, degradation / error correction, temperatures under load, etc.) and changing the sector size will have little effect on that.
If you do decide to change it, you'll have to run your own benchmarks to determine if it helps at all or not.
Offline
Yes I am familiar that changing sector size will erase all data.
Actually I tried with
nvme format --lbaf=1 /dev/nvme0n1but it can't be changed to 4096 because of lacking those option. I just can't see in the output of any command number 4096.
Ukrainian
Offline
Besides script on the https://wiki.archlinux.org/title/Advanc … _alignment any other option to check alignment?
Ukrainian
Offline
Afaik most nvme controllers do alignment internally and they just expose "some value" so traditional partitioning tools don't explode. I doubt you can -- and should not -- be doing much about that.
Offline
Partition alignment? You can check `head /sys/block/*/*/start` (this lists the start offsets of each partition in your system) and for MiB alignment, each number should be a multiple of 2048; for 4K alignment, a multiple of 8; assuming 512 byte sectors.
However for filesystem alignment, the offsets of LUKS, RAID, LVM etc. also matter (if you use other storage layers between partition and filesystem). It's just that pretty much everything aligns by default these days so there is rarely a need to actually go and check.
Actually I tried with
nvme format --lbaf=1 /dev/nvme0n1
This could mean anything, not necessarily 4096 sector size. 1 is just an arbitrary ID as listed by id-ns or smartctl -c commands.
nvme is a "dangerous" tool, it can delete your data and screw you up other ways, you don't want to blindly run commands here.
I just can't see in the output of any command number 4096.
Not all devices support it... if in doubt, just leave as is. Sticking to default settings has its own merits. Less likely to trigger firmware bugs and other compatibility issues.
Offline