How do I fix SAS drives stuck at 520-byte sectors?
Sources checked · page updated · the question as people ask it: “I bought used SAS drives that came out of a NetApp or EMC array, and Linux, TrueNAS or my RAID controller will not use them because they report 520-byte sectors - how do I get them back to 512 or 4096 bytes?”
A 520-byte sector is a 512-byte sector with 8 bytes of checksum or protection information appended; NetApp's own patent describes 520-byte sectors used this way, and Linux rejects 520 as a block size. On a SAS drive that Linux can address as /dev/sgN, sg_format --format --size=512 (or --size=4096 where the drive supports it) rewrites it to a usable size; it destroys all data and can take hours, or days on disks over 10 TB. In forum reports some array-branded drives refused every format attempt; for those, a replacement drive is the remaining fix.
What are you seeing?
Pick the closest symptom to open the matching diagnostic path. This is a guide to what to check and in what order; it does not read your system and does not diagnose it.
Confirm the sector size and protection setting
- 1.List the SCSI devices with their generic names. sg_readcap and sg_format address the /dev/sgN name, not /dev/sdX.
lsscsi -gReadingThe last column is the /dev/sgN name for each /dev/sdX. A '-' there can mean the sg module is not loaded; load it with modprobe sg and run lsscsi -g again. If a disk you installed is not listed on its own, check the controller mode (path p3). - 2.Check what the kernel recorded for size and sector size. Do not trust LOG-SEC alone on a suspect drive.
lsblk -o NAME,SIZE,LOG-SEC,PHY-SECReadingLOG-SEC and PHY-SEC are the sizes the kernel recorded, not a fresh query of the drive. When Linux rejects a 520-byte drive it sets the capacity to 0 and falls back to 512, so SIZE 0B is the tell and LOG-SEC can still read 512. Confirm with sg_readcap. - 3.Read the kernel's own verdict on the drive's format.
dmesg | grep -iE 'sector size|DIF|protection'Reading'Unsupported sector size 520.' means the drive is formatted with 520-byte blocks. 'Enabling DIF Type 1/2/3 protection' with no 'Disabling' line before it means protection information is in use. A 'Disabling DIF Type N protection' line followed by 'Enabling DIF Type 0 protection' means the drive is protection-formatted but this host cannot use it. 'formatted with unsupported protection type' means a protection type the kernel does not support (above type 3), and the kernel disabled the disk. - 4.Ask the drive directly. READ CAPACITY(16) returns the block size and the protection setting.
sg_readcap --long /dev/sgNReading'Logical block length=520 bytes' is the problem; 512 or 4096 is usable. 'Protection: prot_en=1, p_type=0' with '[type 1 protection]' means protection information is on (the type is p_type+1); prot_en=0 means none. 'Logical blocks per physical block exponent' gives the physical size. - 5.Cross-check with smartctl.
smartctl -i /dev/sgNReading'Logical block size: 520 bytes' confirms the sector size. 'Formatted with type 1 protection' (or type 2 or 3) means protection information is enabled even when the block size reads 512. - 6.Record the vendor, model and firmware revision before changing anything, and confirm this is the drive you mean to work on.
sg_inq /dev/sgNReadingShows the vendor, model and revision from the standard INQUIRY data. Note the array-branded model and the firmware revision before you format. - 7.Run sg_format without --format. In this form it only reports and does not touch the disk.
sg_format /dev/sgNReadingPrints the current block size and block count and does not modify the disk. A TrueNAS community guide shows this output as 'Block size=520' on an affected drive.
Reformat to 512 or 4096 bytes
- 1.Before anything else: every command in this path destroys all data on the drive. Copy off anything you need. Run the format inside tmux or on the console, do not reset or power cycle the drive until it finishes, and avoid running other tools against the drive while it formats. An interrupted format can leave the disk 'format corrupt', which takes another format to recover.
- 2.This destroys all data on the drive. Change the logical block size to 512. sg_format sends MODE SELECT to set the size, then FORMAT UNIT. With the default --fmtpinfo=0 it formats with protection type 0, meaning no protection information.Destructive. This command destroys what is on the device and cannot be undone. Confirm the device path twice and have a backup of anything you still need before running it.
sg_format --format --size=512 /dev/sgNReadingsg_format polls the drive every 60 seconds and prints a percentage. A full format can take many hours, and days on hard disks over 10 TB. - 3.This also destroys all data on the drive. Use it instead of the 512 command if you want 4096-byte logical blocks: some SCSI disks accept 4096 as an alternate size, and which sizes a drive accepts depends on the model. Same timing and interruption rules as above.Destructive. This command destroys what is on the device and cannot be undone. Confirm the device path twice and have a backup of anything you still need before running it.
sg_format --format --size=4096 /dev/sgNReadingProgress and timing as for the 512 format. If the drive rejects 4096, it may still accept 512. - 4.If sg_readcap showed 512 bytes with prot_en=1, the block size is already right and protection information is what the host objects to. The 512 command above formats with protection type 0 by default, so it also clears protection, and it destroys all data in the same way. One TrueNAS community guide ran protection removal and the size change as two separate formats; the man page does not require that.
- 5.When the format finishes, read the capacity again to confirm the result.
sg_readcap --long /dev/sgNReading'Logical block length=512 bytes' (or 4096) and 'prot_en=0' means the drive is in a format Linux accepts. Anything else after an interrupted run means the format did not complete; run it again.
When the format fails or never finishes
- 1.This destroys all data on the drive. If the default command is rejected, retry with --six, which uses 6-byte MODE SENSE and MODE SELECT instead of the default 10-byte commands. One Level1Techs poster with NetApp drives in a DS2246 shelf behind a Dell H200e reported needing it; that is a forum report, not a documented brand rule. Separately, in the same thread, the poster who hit 'Parameter list length error' on the first attempt reported fixing it by reissuing the format at 512 immediately after a format at 520; that is a single report.Destructive. This command destroys what is on the device and cannot be undone. Confirm the device path twice and have a backup of anything you still need before running it.
sg_format --format --size=512 --six /dev/sgNReadingSame progress output, timing and interruption rules as the default format. - 2.This destroys all data on the drive. On Seagate drives, Seagate documents changing the sector size between 512 and 4096 with SeaChest_Format on models that support it. Check the model's data sheet, manual or SeaChest's Feature Supported output first, and disable out-of-band management services, smartd among them, before you start. Seagate notes that a sector-size change may affect every LUN or namespace on a multi-LUN device. Seagate's page does not mention 520-byte drives, so treat this as a second route, not a known fix.Destructive. This command destroys what is on the device and cannot be undone. Confirm the device path twice and have a backup of anything you still need before running it.
SeaChest_Format -d /dev/sgN --setSectorSize 4096 --confirm this-will-erase-data-and-may-render-the-drive-inoperableReadingSeagate says the longest wait for a SATA drive is 5 hours, and that any interruption while formatting may render the device inoperable. - 3.After the SeaChest change, check the drive with SeaChest's information option, as Seagate's page shows.
SeaChest_Format -d /dev/sgN -iReadingCheck the sector size the drive now reports. sg_readcap --long gives the same check. - 4.Do not repeat --format three times to force a size change. The man page says three or more --format flags skip MODE SENSE and MODE SELECT, and in that mode sg_format cannot change the logical block size. One forum reply reported otherwise; it is a single report against the documentation.
- 5.Check what the drive is connected to. Where a thread named the controller and its mode, it was an IT-mode card or an HBA (Dell H200 and H710 in IT mode, an LSI 9200-8e in IT mode, an HPE H240); one Level1Techs poster used a Dell PERC200 and did not say which mode. TrueNAS warns that hardware RAID controllers can mask disk serial numbers and SMART data and recommends HBA mode or IT-mode firmware. We found no vendor document stating that a RAID-mode controller blocks the format, but a disk behind a RAID-mode controller may not be listed individually, so if the disk has no /dev/sgN entry of its own, the controller mode is the first thing to check.
- 6.Know when to stop. An interrupted format can leave the disk 'format corrupt', and another format is the remedy. In the threads we read, drives that returned Illegal Request or Hardware Error to every attempt were never reformatted: a NetApp drive returning Illegal Request to both sg_format and setblocksize, ex-NetApp Seagate ST3000NM0023 drives that refused every option, and a NetApp Samsung PM1643 SAS SSD that failed with 'Device internal reset'. One TrueNAS user's format stalled at 89.99% after three days, twice; replies there raised drive heat, not a diagnosis. For a drive that refuses every attempt, a replacement drive is the remaining option.
Causes, how to confirm each, and whether hardware fixes it
| Cause | How to confirm | Fix | Hardware? |
|---|---|---|---|
| The drive is formatted with 520-byte sectors: 512 bytes of data plus 8 bytes of checksum or protection information. Linux accepts only power-of-two block sizes of at least 512 bytes. | sg_readcap --long shows 'Logical block length=520 bytes'; dmesg shows 'Unsupported sector size 520.'; lsblk shows SIZE 0B. | Reformat on an HBA with sg_format --format --size=512 (or --size=4096 if the model supports it). Destroys all data. | No |
| The drive is 512-byte but formatted with T10 protection information (type 1, 2 or 3). | sg_readcap --long shows prot_en=1 and '[type 1 protection]'; smartctl -i prints 'Formatted with type N protection'; dmesg shows 'Disabling DIF Type N protection'. | Reformat with protection type 0, which is sg_format's default (--fmtpinfo=0). Destroys all data. | No |
| The sg driver is not loaded, so the drive has no /dev/sgN name for sg_readcap and sg_format to address. | lsscsi -g shows '-' in the generic-name column; a '-' there can mean the sg module is not loaded. | Load the module with modprobe sg and run lsscsi -g again. | No |
| The controller does not present the disk individually. We found no vendor document stating that a RAID-mode controller hides 520-byte drives or blocks the format; TrueNAS recommends HBA mode or IT-mode firmware, and the threads that named a controller's mode used an HBA or IT-mode card. | The disk has no entry of its own, and no /dev/sgN name, in lsscsi -g. | Put the controller in HBA or IT mode if it offers one, or run the format on an HBA in IT mode (see the HBA pages linked below). | No |
| The drive will not accept a size change. Posters suspected firmware locks; no source confirms why, and in the threads we read such drives were never reformatted. Which sizes a drive accepts depends on the model. | sg_format --format returns 'Sense key: Illegal Request' or 'Hardware Error' on the default command and with --six. | Replace it with a SAS drive stored in our catalogue as 512n, 512e or 4Kn, and check it with sg_readcap --long when it arrives. | Yes |
When a drive returns Illegal Request or Hardware Error to every attempt, the remaining fix is a SAS hard drive in a 512n, 512e or 4Kn format; the sector format in this table is the label stored in our catalogue for each listing, not sourced from a maker document, and we have not checked that every listing states it. Array-branded used drives (OEM part numbers, Compellent and NetApp pulls) can arrive in an array format, and the Seagate ST3000NM0023 is the model one TrueNAS thread could not reformat, so run sg_readcap --long on any drive when it arrives; the table shows each offer's condition, and most of the cheapest are used or renewed.
When not to buy: Do not buy before you have run sg_format on an HBA or IT-mode card: the documented route for a 520-byte drive is a software format. No listing in our catalogue is stored as a 520-byte drive.
| Product · part number | Capacity | Interface · form | Condition | Price | $/TB | Criteria | |
|---|---|---|---|---|---|---|---|
HP ST31000640SS 1TB SAS ST31000640SS · details | 1TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: Used / LikeNew · sold by CSA Computers · seller's note on the listing | $14.99 | $14.99 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
HGST HUS724030ALS640 3TB SAS 6G HUS724030ALS640 · details | 3TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: Used / LikeNew · sold by Tech on Time (SN RECORDED) | $45.39 | $15.13 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
Seagate Constellation ES.2 3TB SAS Enterprise ST33000650SS · details | 3TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: Used / LikeNew · sold by Tech Original | $48.00 | $16.00 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
Seagate Constellation ES.2 3TB SAS ST33000650SS · details | 3TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: New / New · sold by RENEW COMPONENTS | $51.00 | $17.00 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
HP 695842-001 4TB SAS 6G 695842-001 · details | 4TB | SAS-6G · 3.5" · 512n | NEW Amazon: New / New · sold by Computer Supply | $68.00 | $17.00 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
HGST Ultrastar HUS723030ALS640 3TB SAS 6G HUS723030ALS640 · details | 3TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: Used / Good · sold by Tech Original | $55.00 | $18.33 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
HP MB3000FBUCN 3TB SAS 6G MB3000FBUCN · details | 3TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: New / New · sold by Redefine IT | $59.53 | $19.84 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
MDD 3TB SAS 6G 7200RPM MD3TSAS12872E · details | 3TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: New / New · sold by Worldwide Product Importer | $59.99 | $20.00 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
Dell 012GYY 4TB SAS 6G Renewed 012GYY · details | 4TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: New / New · sold by Computer Supply | $85.00 | $21.25 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
Dell DRMYH Compellent 4TB NL SAS Renewed DRMYH · details | 4TB | SAS-6G · 3.5" · 512n | REFURB / USED Amazon: New / New · sold by Redefine IT | $89.98 | $22.50 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
Seagate ST3000NM0023 3TB SAS 6G 7.2K ST3000NM0023 · details | 3TB | SAS-6G · 3.5" · 512n | NEW Amazon: New / New · sold by RENEW COMPONENTS | $69.00 | $23.00 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
HGST Ultrastar He10 10TB SAS 12G HUH721010AL5200 · details | 10TB | SAS-12G · 3.5" · 512e | REFURB / USED Amazon: Used / LikeNew · sold by Computer Supply | $235.00 | $23.50 | SAS interface (sg_format only addresses SAS/SCSI disks)Stated sector format 512n, 512e or 4Kn (not 520/528) | Buy on Amazon |
Prices are Amazon US, re-checked about once a day; newest price in this table . A click here is a click, not a purchase; we earn a commission on qualifying purchases. The table shows what the catalogue holds against the criteria, not an endorsement of any model for your server.
Read next on this site
- IT mode explained · What IT mode is and how it differs from IR and RAID firmware, for putting the drive on a controller that presents it directly.
- Server HBA and RAID cards · The HBA and RAID card catalogue, if the drive is behind a controller that cannot present it individually.
- SAS hard drive prices · Every SAS hard drive we track, with the sector format stored in our catalogue for each listing, which is not sourced from a maker document.
- SAS vs SATA hard drives · Why a SAS drive needs a SAS host adapter, before you choose a replacement.
- NetApp DS4246 shelf · Specs, cabling and listings for the shelf many of these drives come out of.
- Refurbished vs recertified vs renewed · What the condition labels on used array pulls mean.
Frequently asked questions
How long does a 520 to 512 reformat take in practice?
The sg_format man page says a full format can take many hours, and days on hard disks over 10 TB. In the threads, one Level1Techs reply reported anywhere from 10 minutes to 10 hours, and one TrueNAS user saw a format stall at 89.99% after three days, twice; replies there warned about drive heat during long formats.
Can I reformat 520-byte SATA SSDs from an EMC array the same way?
Not in any thread we found. A TrueNAS user with over 100 EMC-sourced SATA SSDs could not reformat them with sg_format, a reply said 'sg_format only works with sas/scsi disks', and no fix for the SATA drives was recorded. A NetApp Samsung SM1633 SAS SSD in the same thread did reformat with sg_format. This rests on forum reports only.
Should I update the drive's firmware before reformatting?
We found no document that says so. In one ServeTheHome thread a NetApp-branded Samsung PM1643 failed to reformat after a firmware update from NA52 to NA54, and a reply noted an earlier success was on NA53 and suggested NA54 may have removed the option. Record the firmware revision with sg_inq before changing anything.
Sources
Every technical statement above rests on one of these documents, each read on the date shown. Where a document did not state something, the page says so rather than filling the gap.
- sg_format(8) · checked
- sg_format(8) - PROTECTION INFORMATION section · checked
- sg_format(8) - NOTES on changing block size · checked
- sg_format(8) - --ffmt, --wait, IMMED and interruption · checked
- sg_format(8) - report-only use, --fmtpinfo, --six, -FFF · checked
- sg_format(8) - 4096-byte alternative · checked
- sg_readcap(8) · checked
- sg_readcap.c output format strings · checked
- Data Integrity (block/data-integrity) · checked
- System and method for emulating block appended checksums on storage devices by sector stealing · checked
- sd_read_capacity() · checked
- blk_validate_block_size() · checked
- lsblk column table · checked
- lsscsi(8) · checked
- sg_inq(8) · checked
- scsiGetDriveInfo output · checked
- How to change sector size on SATA or SAS drives using SeaChest · checked
- TrueNAS CORE Hardware Guide · checked
Where people hit this
Discussions we opened and read while researching this page. They are evidence that the problem occurs and of what people tried; no specification above is sourced to a forum post.
- Level1Techs forum · 2018-09-26 · A reformatting guide with three years of replies: a first sg_format --size=512 attempt failing with 'Parameter list length error', worked around by formatting at 520 then immediately at 512; a dmesg showing 'Unsupported sector size 520.'; a poster reporting --six helped on NetApp drives in a DS2246 behind a Dell H200e; one set of drives that formatted then threw hardware errors; and Samsung EMC SATA SSDs that would not format at all.“Unsupported sector size 520.”
- Level1Techs forum · 2025-05-09 · A NetApp 520-byte SAS disk returned 'Sense key: Illegal Request' to both sg_format and setblocksize; the poster suspected a firmware lock, a reply doubted it. No resolution recorded.
- TrueNAS Community (legacy forum) · 2022-01-21 · Ex-NetApp Seagate ST3000NM0023 drives behind an LSI 9200-8e in IT mode refused sg_format with and without --fmtpinfo=0 and --six, and setblocksize; the thread ends with no fix.
- TrueNAS forums · 2025-03-19 · Ten ex-EMC HGST HUS724040ALS640 drives on a Dell H710 mini in IT mode: sg_format stalled at 89.99% after three days, twice; badblocks reported 'Invalid block size: 520'; replies warned about drive heat during formatting.
- TrueNAS Community resource (legacy forum) · 2022-12-16 · A community guide to TrueNAS SCALE's DIF warning: checks with sg_readcap -l, sg_format -v and smartctl -i, then removes protection information and fixes 520-byte sectors with separate sg_format runs; replies report long-running formats on HGST drives.
- ServeTheHome forum · 2023-05-06 · A NetApp-branded Samsung PM1643 SAS SSD on an HPE H240 failed sg_format --size=512 with 'Hardware Error' and 'Device internal reset' after a firmware update from NA52 to NA54; a reply noted an earlier success on NA53. No resolution.
- TrueNAS forums · 2024-07-10 · Over 100 EMC-sourced SATA SSDs with 520-byte sectors could not be reformatted with sg_format; a NetApp Samsung SM1633 SAS SSD in the same thread was. No fix for the SATA drives.“sg_format only works with sas/scsi disks”
Other sas/sata drives and controllers problems
- Why won't my server see or boot a 4Kn SAS drive?
- HBA or RAID controller for TrueNAS: can you keep the card you have?
- Are refurbished enterprise hard drives worth it once the warranty and the failure risk are counted?
- SAS expander or a 24-port HBA: which does a 24-bay chassis need?
- Why is my SAS hard drive not detected by the HBA?
- All questions →