Talk:Advanced Format

From ArchWiki

Workaroud for booting from AF discs with more than 512 bytes sector size

I am worried that my server hard disk crash and will not be able to get a 512 Sectors hard disk from the market. Recently, I went shopping for a new disk. All new disks from Western Digital and Seagate have AF (advanced format) label. I bought Seagate 2TB, model ST2000DM001. Its date of manufacture is May 2012. No luck, it is 4096/4096 logical/physical. Fedora 17 can be installed to it but cannot write to its MBR.

My solution was mounting the disk to / and mounting a flash memory sandisk with a ext4 partition to /boot. During installation, F17 writes boot sector to mbr of / disk. To write to mbr of /boot disk, use F17 to rescue. The following commands were used to write to mbr of /boot disk:

  1. chroot /mnt/sysimage
  2. grub2-install /dev/sdx

where sdx is the sandisk.

These take away my worry as sandisk sectors are 512. They are available in the market.

Hello Thomasleow. Thanks for contributing to this Wiki, but I think your guide does not belong in this Talk page. If you have questions you should use the forum. since you found a solution for a problem you should add a section in the Wiki. But you also seem to use Fedora, so this does not belong here at all, as this Wiki is Arch related (you could leave out the Fedora part and replace it with with an Arch related procedure, though).
Also please add a new section for your topic on the Talk pages and sign your contributions.
6arms1leg (talk) 09:13, 10 August 2012 (UTC)Reply

Rewrite Advanced Format to a new Sector Sizes page

Here is a draft of a new page which would group info about sector sizes : User:Cvlc/Sector Size

The goal is to have a simple place to get info from during Installation by merging :

User:Cvlc/Sector Size is a draft, some parts were just copied over and need to be completely rewritten (Filesystems and Dm-crypt notably). Any help is welcome !

-- Cvlc (talk) 23:07, 24 November 2021 (UTC)Reply

I like the idea of merging all that stuff in one page. I'm not too sure about the new page name, though. I suggest that you first merge all the listed sections into Advanced Format. Whether to rename it, and to what, can be decided afterwards. -- nl6720 (talk) 09:42, 25 November 2021 (UTC)Reply
I initially changed the title because the term Advanced Format only applies to HDDs and not SSDs. See [1]. So we need to look for a title that can encompass that, and the dm-crypt or filesystem stuff as well. How about Storage Layout and Alignment ? and then merging
WIP here User:Cvlc/Storage_Layout_and_Alignment
Or maybe move the whole page to a new Improving performance/Partitioning. But it kind of collides with Partitioning.
-- Cvlc (talk) 12:32, 25 November 2021 (UTC)Reply
I saw the draft, it looks like a good start. I'm just saying, that there's no point in trying to create the perfect draft, simply edit Advanced Format until it matches the wanted content. The page can then be moved to a suitable name (pay attention to Help:Style#Title, though).
As for the new title, I don't think it would belong as a subpage of Improving performance and neither of Partitioning, since it starts from a level lower than partitioning and goes all the way to file system formatting.
-- nl6720 (talk) 07:27, 26 November 2021 (UTC)Reply
Updated the page from the draft. Still needs a better name, as "AF" is specific to Hard drives. Best I can think of is "Storage layout and alignment"
-- Cvlc (talk) 03:37, 4 December 2021 (UTC)Reply
After discovering that some HDDs can change their sector size too, I'm thinking if it would not be better to merge "Check supported sector sizes*" with "Setting native sector size" into "Check and change sector size" and make it a top level section. -- nl6720 (talk) 15:36, 2 March 2022 (UTC)Reply
Can't say I'm a big fan of the new layout, it causes some redundancy in the "change sector size" sections. Some text doesn't make much sense anymore after having been moved around so much. ot sure how to best organize this page.
-- Cvlc (talk)
Yes, it needs further improving. E.g. Advanced Format#Advanced Format hard disk drives has too much unnecessary fluff, like the logo colors. The page also does not clearly explain what are the physical and logical sector sizes. My idea was to better split the check and set sections, but, yeah, there is some avoidable redundancy. Perhaps the parts of Advanced Format#Check supported sector sizes could be merged into the intro and Advanced Format#Setting native sector size to avoid this. -- nl6720 (talk) 16:33, 28 June 2023 (UTC)Reply
My thoughts seem to be going in circles. I should have just merged the check and set sections like I suggested more than a year ago. -- nl6720 (talk) 17:37, 28 June 2023 (UTC)Reply
I have some ideas. For the article name, how about Optimizing sector sizes and partition alignment for storage devices ?
Did a lot of cleaning. Feel free to revert if that's too much. The title really needs to change though.
-- Cvlc (talk) 00:12, 29 June 2023 (UTC)Reply
Looks good for the most part, thanks!
The "Page size" description in the intro could use some improvement to avoid confusion with w:Page (computer memory).
And I'm not too sure about the need for Advanced Format#Solid state drives. "LBA Sizes" are a NVMe thing. Non-NVMe SSDs would not report such a thing.
-- nl6720 (talk) 08:00, 30 June 2023 (UTC)Reply
That name looks too long for me. "Storage layout and alignment" sounds better, but I'm not sure what "layout" has to do with the topic. There's a RHEL 7 doc titled Storage I/O Alignment and Size whose name looks a little more appealing. -- nl6720 (talk) 13:40, 6 July 2023 (UTC)Reply
How about 'Optimizing sector size and alignment' for a shorter version ?
I've flagged the intro, the commands to display the 'physical' sector size don't work (at least) for NVMe drives. They report 512 all around for my system. -- Cvlc (talk) 22:02, 10 July 2023 (UTC)Reply
Personally I don't like the idea of including "optimizing" in the article title, IMO the word should be reserved for a section about drives that do not and cannot change the logical sector size to 4096 bytes (I'll create a separate talk about that soon™). I'm thinking that perhaps, just like the RHEL doc, we should explain all the values in sysfs/lsblk output.
I don't see what's inaccurate about the intro. The physical sector size description says "SSDs do not expose their actual NAND flash memory page size, which typically ranges from 4 KiB to 16 KiB, instead their reported physical sector size is the same as their logical sector size. For NVMe SSDs, if it is available, the Atomic Write Unit Power Fail (AWUPF) parameter value is used." Unless things in the industry change, you'll never see vendors revealing the actual page size for SSDs.
-- nl6720 (talk) 14:06, 12 July 2023 (UTC)Reply
What I mean is that it's misleading, because for most modern drives, it might print out a "physical sector size" which is not the "physical sector size" in the sense of the article, which is confusing:
$ lsblk -td
zram0           0   4096   4096    4096    4096    0           128 128    0B
nvme0n1         0    512      0     512     512    0 none     1023 128    0B
$ cat /sys/class/block/nvme0n1/queue/physical_block_size
$ cat /sys/class/block/nvme0n1/queue/logical_block_size

On this (not optimized) drive, one would probably mistakenly think that there is nothing to do. I think it's best to remove those commands from the intro because they only cover a subset of cases. -- Cvlc (talk) 11:25, 13 July 2023 (UTC)Reply

The "physical sector size" description clearly says that the value for SSDs is pure fiction. For SATA, it's just a number that the drive reports and for NVMe it's not even that. You need those commands in the intro, otherwise you wouldn't know if you should even proceed with the following sections. Perhaps the intro should explain the greater goal, i.e. to have 4096 byte blocks in as many layers as possible for everything except 512n HDDs. -- nl6720 (talk) 12:10, 13 July 2023 (UTC)Reply
And how about using smartmontools only in the intro ? The smartctl output would be more meaningful in all cases, albeit not as readable. It could then be removed from the NVME subsection ?
[edit] Something such as # smartctl -a /dev/drive | grep -E '(Sector|LBA)\sSize\b'
# smartctl -a /dev/nvme0n1 | grep -E '(Sector|LBA)\sSize\b'
Namespace 1 Formatted LBA Size:     512

# smartctl -a /dev/sda | grep -E '(Sector|LBA)\sSize\b'
Sector Size:      512 bytes logical/physical
Actually, this can be removed from the intro and moved into a first subsection, which explains the 'greater goal' and details the output.
[edit2] Actually that doesn't really list possibilities either. Still I think a proper first section like the old "checking sector size" is needed, even if we need separate commands for separate drives.-- Cvlc (talk)
IMO having "checking" and "changing" in separate interlinked sections makes the page harder to follow. -- nl6720 (talk) 13:36, 16 July 2023 (UTC)Reply

Optimizations for 512e

IMO the article doesn't make it clear enough that drives that report a 4096 byte logical sector size do not need any special consideration when setting up dm-crypt/LUKS or formatting them with a file system.

I'd like to make Advanced Format#dm-crypt and Advanced Format#File systems into subsections of a "Optimizations for drives that do not report 4096 byte logical sectors" (name subject to change) top level section. The section would explain to which drives the following sections apply to.

Advanced Format#Partition alignment would remain a top level section since partitions on an SSDs should be aligned to MiB and, to avoid issues when cloning from and HDD to SSD, it's best to give it as a general advice for HDDs too.

-- nl6720 (talk) 14:36, 12 July 2023 (UTC)Reply

Hm, not too sure about that. I like that it's organized in layers like data on a disk. How about just a Tip or Note in the appropriate sections ? -- Cvlc (talk) 11:22, 13 July 2023 (UTC)Reply
I get your point. My motivation was to not give useless instructions for those with 4096 logical sectors drives. -- nl6720 (talk) 12:14, 13 July 2023 (UTC)Reply