Edit: feedback
Thanks for all the advice! Here’s some funny feedback: it was a faulty drive 🤣 give me back my feelings 😭 obviously I’m sending it back

dhWvundoMJKYgdc.jpg

I have just received my Seagate 18TB IronWolf Pro HDD and the specs say that the logical sector size is 512 emulated. Moreover, Seagate says that switching to 4096 sector size is as easy as doing a quick format (Windows terminology?). I suppose on Linux this simply means creating a filesystem with that block size? For instance mkfs.ext4 -b 4096 /dev/device or - in my specific case - cryptsetup luksFormat --sector-size=4096 and then creating a file system?

What confuses me is the Arch Wiki article on advanced format that has instructions on how to use hdparm to tell the firmware to use a certain sector size.

Do I need to do the hdparm thing, which seemingly conflicts with the Seagate instructions?

  • bizdelnick@lemmy.ml
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    1 day ago

    TL;DR: Everything should work well with default settings, no special actions required.

    First of all, partitions must be aligned to sector size (multiples of 4096). Most partitioning tools align partitions to 1MiB by default nowadays, so this shouldn’t be a problem, however if the disk is already partitioned, check the partition offset. For ext4, as well as most modern filesystems, default block size is 4KiB, so you don’t need to pass optional parameters to mkfs. For cryptsetup luksFormat there are also two things that must be set correctly: --align-payload (2048 512-byte sectors by default, equal to 256 4096-byte sectors, no need to change), and --sector-size (for 512e device it should be set to 4096 bytes automatically, no need to set manually).

    • printf("%s", name);@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      Sweet! I feel this kind of “proves” Seagate’s stance, in other words, that a quick format will suffice, since most tools these days defualt to 4096 byte sectors. Although one has to read between the lines a bit…

      Thanks for your help!

      • non_burglar@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        1 day ago

        Except for leaving things default, almost none of that comment is true.

        4k is default for most disks today. Some transition-era ssds used 8k blocks.

        Do not worry about emulated block size, because ssds only use that to report to the filesystem, no sectors exist on solid state media.

        • SteveTech@aussie.zone
          link
          fedilink
          arrow-up
          2
          ·
          19 hours ago

          Do not worry about emulated block size, because ssds only use that to report to the filesystem, no sectors exist on solid state media.

          Well SSDs have flash pages, which are essentially sectors as they are the smallest unit you can read/write, and they’re usually 4096 bytes on NAND flash. My understanding is to write to a flash page you have to erase the whole block of 32+ pages before writing, so if a 512e SSD doesn’t receive the rest of the page in time (e.g. with IO scheduling, 512 byte fs sectors, unaligned partitions, or bad luck), then the controller has to do a read-erase-program across the whole block of pages (although wear leveling will probably read + copy the modified page to elsewhere instead), instead of just a single program operation on one page (assuming a properly trimmed SSD).

          So IMO, 4Kn is more important on SSDs, yet every vendor sets 512e by default. Luckily quite a few NVMe SSDs (not Samsung), let you change the logical block size with an nvme format command.

          But more related to the OP, HDDs are a lot slower and don’t have to erase multiple sectors before a write, so it’s not as important, however partition alignment is still important but usually handled automatically in every modern partitioning tool. Sometimes you can switch a HDD to 4Kn with hdparm, but this isn’t common, and you’ve said your HDD is dead anyway, so it won’t help.

          Also, sorry about bringing you into this, I have strong opinions against 512e SSDs haha.

          • non_burglar@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            15 hours ago

            I think we’re talking past each other here: You are talking about blocks as physical delineations in an ssd, containing many pages with erase cycles. Op is talking about the filesystem view of blocks, which is different altogether. ZFS, for instance, should have its block size aligned with what a disk presents to the HAL, or you end up with lots of wasted space or terrible performance.

            For SSDs (you’re right, outside op’s problem), the internal block size is usually much bigger than the emulated block size, often 128K. But we don’t use filesystems with 128K block sizes, or we couldn’t reasonable run databases or store small files.

            There was a brief time in the wild west of SSDs being new where some shipped with 8k blocks, but this caused a bunch of problems for storage drivers because no one had yet decided if the translation of FS blocks to should be handled by filesystems or by disk firmware. We now let manufacturers decide how they should r/w to media, and trust the firmware’s presented block size.

            That block size is now 4k for most disks, spinning or ssd. We still see some weird layouts in high-performance or high-endurance disks, but they are exceptions.

            so if a 512e SSD doesn’t receive the rest of the page in time (e.g. with IO scheduling, 512 byte fs sectors, unaligned partitions, or bad luck)

            I’m not sure what this means, pages are a concept in an ssd’s physical structure, they don’t mean anything to a filesystem (except in volatile memory).