======Reformatting 520-Byte SAN Drives====== Certain hard drives can be found cheap (too cheap) on eBay and through bulk resellers. You attach them to your PC and...no deal. Check your logs and you see Linux complaining about unsupported 520-byte sectors. What to do? //Some// drive models can be reformatted to support the traditional 512-byte sector size using the [[https://packages.debian.org/search?keywords=sg3-utils|sg_utils]] package and/or the [[https://github.com/ahouston/setblocksize|setblocksize]] utility. =====Process===== Drives were tested under Debian Linux 12.9. SAS drives were attached to an LSI SAS2308 (also SAS9207-8i) PCIe controller with firmware revision 20.00.06.00-IT. Once identifying the drive with the *sg_map* and *sginfo* commands, the successful reformat command was: ''sg_format --format --size=512 -v '' It has been reported (not tested) that certain drives (e.g. HP 3PAR/Sandisk SAS 1.92TB SSD aka DOPE1920S5xnNMRI) require the "--six" option to accommodate 6-byte MODE SENSE vs the default 10-byte): ''sg_format --format --size=512 --six -v '' It is not known yet whether sg_utils will work on SATA drives. Since they use the ATAPI command set vs SCSI, probably not. =====Tested Drives===== ^Make^Model^Size^Interface^Test^Notes^ |HGST|HUSMM8080ASS200|800GB|SAS|OK|Double-height 2.5" SSD| |Micron|MTFDDAK200MAN-2S1AA((https://www.reddit.com/r/homelab/comments/ri33ur/how_to_use_ssd_with_locked_520_bytes_block))((https://forum.hddguru.com/viewtopic.php?f=10&t=37553))|200GB|SATA|NO|AKA P400m, probably locked firmware| |Samsung|MZ-3S9200T/0C3 (SS161512)|200GB|SATA|NO|aka MZ3S9200HMDP-000C3| =====Other Useful Utilities===== * [[https://man7.org/linux/man-pages/man8/hdparm.8.html|hdparm]] * [[https://manpages.debian.org/testing/udisks2/udisks.8.en.html|udisks]] * [[https://www.hdat2.com|HDAT2]] * [[https://linux.die.net/man/8/bonnie++|bonnie++]]