Hi guys.
I wonder if anybody played with both sector sizes 512 & 4086 and if yes so - also had some test results / thoughts to share?
There are bits about it - bit confusing & a mixed-bag - over the net but I failed to find anything Fedora-specific.
thanks, L.
On Wed, Jan 10, 2024 at 4:58 AM lejeczek via users users@lists.fedoraproject.org wrote:
I wonder if anybody played with both sector sizes 512 & 4086 and if yes so - also had some test results / thoughts to share?
There are bits about it - bit confusing & a mixed-bag - over the net but I failed to find anything Fedora-specific.
I think it depends on the storage controller. For modern storage, the device probably has 4096-byte sectors, but it could emulate 512-byte sectors. Also see https://en.wikipedia.org/wiki/Advanced_Format.
Jeff
lejeczek via users composed on 2024-01-10 10:58 (UTC+0100):
I wonder if anybody played with both sector sizes 512 & 4086 and if yes so - also had some test results / thoughts to share?
There are bits about it - bit confusing & a mixed-bag - over the net but I failed to find anything Fedora-specific.
I've never encountered information that any SSD uses anything but 512. I certainly wouldn't expect anything on the subject to be Fedora specific. All mine are 512. I don't think the role of bit density is the same on solid state media as on rotating rust.
Almost all NVMe drives use 4k sectors. Its actually hard on the drive to use 512 byte sectors, as when you write a block and sync it, it has to read and then rewrite the rest of the 4k block. That's unnecessary writes, shortening your drive life. Most Linux platforms will read the natural sector size from the drive when you format it, so using 512 byte sectors is pretty rare these days, unless you forced it of course.
On 2024-01-10 4:58 a.m., lejeczek via users wrote:
Hi guys.
I wonder if anybody played with both sector sizes 512 & 4086 and if yes so - also had some test results / thoughts to share?
There are bits about it - bit confusing & a mixed-bag - over the net but I failed to find anything Fedora-specific.
thanks, L.
-- _______________________________________________ users mailing list --users@lists.fedoraproject.org To unsubscribe send an email tousers-leave@lists.fedoraproject.org Fedora Code of Conduct:https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines:https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives:https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam, report it:https://pagure.io/fedora-infrastructure/new_issue
I just checked my system, and it looks like it's set for 512k blocks:
[root@case ~]# blockdev --report /dev/nvme1n1p4 RO RA SSZ BSZ StartSec Size Device rw 256 512 512 69216256 964765417472 /dev/nvme1n1p4
I assume the installer chose the block size, since I basically did a "next, next, next" installation. Should I have chosen something different?
Thomas
On 1/10/24 11:31, John Mellor wrote:
Almost all NVMe drives use 4k sectors. Its actually hard on the drive to use 512 byte sectors, as when you write a block and sync it, it has to read and then rewrite the rest of the 4k block. That's unnecessary writes, shortening your drive life. Most Linux platforms will read the natural sector size from the drive when you format it, so using 512 byte sectors is pretty rare these days, unless you forced it of course.
On 2024-01-10 4:58 a.m., lejeczek via users wrote:
Hi guys.
I wonder if anybody played with both sector sizes 512 & 4086 and if yes so - also had some test results / thoughts to share?
There are bits about it - bit confusing & a mixed-bag - over the net but I failed to find anything Fedora-specific.
thanks, L.
-- _______________________________________________ users mailing list --users@lists.fedoraproject.org To unsubscribe send an email tousers-leave@lists.fedoraproject.org Fedora Code of Conduct:https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines:https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives:https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam, report it:https://pagure.io/fedora-infrastructure/new_issue
-- John MellorJohn.Mellor@gmail.com 519-721-6671
-- _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Once upon a time, Thomas Cameron thomas.cameron@camerontech.com said:
I just checked my system, and it looks like it's set for 512k blocks:
[root@case ~]# blockdev --report /dev/nvme1n1p4 RO RA SSZ BSZ StartSec Size Device rw 256 512 512 69216256 964765417472 /dev/nvme1n1p4
I assume the installer chose the block size, since I basically did a "next, next, next" installation. Should I have chosen something different?
The underlying NVMe sector size is not something presented for change, because it is destructive.
You can see what your drive supports (and what is active) with "smartctl -c /dev/nvme0n1" (or other if you have more than one) and look at the "Supported LBA Sizes". You can use the nvme command from the nvme-cli package to change it (if your drive supports more than one), and changing it destroys all the contents of the drive. You can't necessarily just restore a filesystem image back to it either; a number of FSes have the underlying raw block size as a basic assumption that cannot be changed after the FS is created.
Even if the presented raw sector size is 512, the drive can typically report the "optimal" size as 4096 (and Linux then uses that info).
On Wed, 2024-01-10 at 12:19 -0600, Thomas Cameron wrote:
I assume the installer chose the block size, since I basically did a "next, next, next" installation. Should I have chosen something different?
I didn't choose block sizes, just some partition sizes in bytes on my systems. So I'd hope the install routine from the ISO files would make some tests and choose things wisely (ha ha!) for me.
CentOS on a HDD:
[root@rocky ~]$ blockdev --report /dev/sda RO RA SSZ BSZ StartSec Size Device rw 256 512 4096 0 1000204886016 /dev/sda
[root@rocky ~]$ fdisk -l /dev/sda WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk label type: gpt
Fedora on a SSD:
[root@fluffy ~]# blockdev --report /dev/sda RO RA SSZ BSZ StartSec Size Device rw 256 512 4096 0 500107862016 /dev/sda
[root@fluffy ~]# fdisk -l /dev/sda Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors Disk model: Samsung SSD 860 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt
And looking into the man file for blockdev:
--getbsz Print the blocksize in bytes. This size does not describe device topology. It’s the size used internally by the kernel and it may be modified (for example) by filesystem driver on mount.
On 01/10/2024 08:48 PM, Tim via users wrote:
I didn't choose block sizes, just some partition sizes in bytes on my systems. So I'd hope the install routine from the ISO files would make some tests and choose things wisely (ha ha!) for me.
If memory serves, if you use a custom partitioning scheme during installation, you can select how big each partition is, what file system to use and if you want the partition reformatted and that's it. You don't have any input into such things as the block size unless you partition your drive manually before starting the installation.
On 1/10/24 20:00, Joe Zeff wrote:
On 01/10/2024 08:48 PM, Tim via users wrote:
I didn't choose block sizes, just some partition sizes in bytes on my systems. So I'd hope the install routine from the ISO files would make some tests and choose things wisely (ha ha!) for me.
If memory serves, if you use a custom partitioning scheme during installation, you can select how big each partition is, what file system to use and if you want the partition reformatted and that's it. You don't have any input into such things as the block size unless you partition your drive manually before starting the installation.
You can pick the size, but it will be rounded to fit the block size that the drive says it wants.
John Mellor composed on 2024-01-10 12:31 (UTC-0500):
Almost all NVMe drives use 4k sectors. Its actually hard on the drive to use 512 byte sectors, as when you write a block and sync it, it has to read and then rewrite the rest of the 4k block. That's unnecessary writes, shortening your drive life. Most Linux platforms will read the natural sector size from the drive when you format it, so using 512 byte sectors is pretty rare these days, unless you forced it of course.
# fdisk -l /dev/nvme0n1 Disk /dev/nvme0n1: 119.24 GiB, 128035676160 bytes, 250069680 sectors Disk model: ZTC-PCIEG3-128G Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xdf5ee151
Device Boot Start End Sectors Size Id Type /dev/nvme0n1p1 2048 516095 514048 251M 6 FAT16 ... # fdisk -l /dev/nvme0n1 Disk /dev/nvme0n1: 238.47 GiB, 256060514304 bytes, 500118192 sectors Disk model: TEAM TM8FP6256G Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 5B330B05-5C88-4DF5-8359-67FF3E52CDC4
Device Start End Sectors Size Type /dev/nvme0n1p1 2048 657407 655360 320M EFI System ... # fdisk -l Disk /dev/nvme1n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors Disk model: Patriot M.2 P300 512GB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 5B330B05-5C88-4DF5-8359-67FF3E52CDC4
Device Start End Sectors Size Type /dev/nvme1n1p1 2048 657407 655360 320M EFI System ... Disk /dev/nvme0n1: 465.76 GiB, 500107862016 bytes, 976773168 sectors Disk model: PNY CS1030 500GB SSD Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 6369E8D7-0B94-4DF5-818C-2CD1A3A780CF
Device Start End Sectors Size Type /dev/nvme0n1p1 2048 657407 655360 320M EFI System ... All 4 report optimal 512. Is fdisk wrong?