Seagate based IBM SAS drives doesn't show full space.

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

BackupProphet

Well-Known Member
Jul 2, 2014
1,096
660
113
Stavanger, Norway
olavgg.com
I got a batch with HGST and Seagate IBM SAS drives with 10TB. The HGST ones are easy to reformat (sg_format) to advanced format (from 4096 to 512 ) for full 10TB, however the Seagate ones seems to be stuck at 9.93 TB no matter what I try.
This is really annoying, have anyone else experience with these? I am at the point where I think I should just resell these.
 

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
Seagate has a lot of annoying bells and whistles. Check logical sector / details in seatools instead. They could have been formatted in something like 4112/4160/4224. Note some disks have 512e (so physically they are still 4Kn just a translation layer for systems to make it look like 512)

also worth noting

1686816042819.png

for 10TB
In 512 sector you are getting 8.8TB of usable space
In 4Kn you are getting 9.73

(its bit more complicated - as its per allocation - but for purpose of showing a point 4096 offers much better efficency - more space)
 

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
Any disk that is 4Kn capable; and all is true:

Logical sector size is 4096+
Physical sector size is 4096+
GPT
Partition is correctly shifted / offsetted, and created with 4096 bytes per sector.
(Most built in partition tools do it incorrectly unless you do some extra work)

After that, it comes to data on the partition. Small files are unlikely to produce good results, while larger files will likely fit better on the partition table.


// HGST SAS 4kn 8+TB Oracle/Sun disks always come correctly shifted. (If you are lazy)

Here's a screenshot of correctly shifted 8TB to 4Kn disk, and one that isn't correctly shifted (still formatted as 4kn).
// those 2 disks are exact same disks - just one is oem.
1686823145826.png
1686823172554.png
(currently working on cleaning up mix/mess for log storage)
 
Last edited:

Whaaat

Active Member
Jan 31, 2020
316
169
43
I mean which tool will report 8.8TB or 9.73TB of 'usable space' for different sector size? Smartctl reports equal User Capacity for 512, 4096 and 4096+T10 logical block sizes
 

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
you can take a look at lshw -class disk should show you information on shift, logical and sector size. (then there are few old threads on formatting disks on the forum using sg_format)

Most tools won't report correct sizes as they calculate space in 512 in first place. (or you may have to run resize count=-1 within sg_format to recalculate the size)
 

Whaaat

Active Member
Jan 31, 2020
316
169
43
Partition is correctly shifted / offsetted, and created with 4096 bytes per sector.
(Most built in partition tools do it incorrectly unless you do some extra work)
Here's a screenshot of correctly shifted 8TB to 4Kn disk, and one that isn't correctly shifted (still formatted as 4kn).
If disk is already formatted with reduced LBA count no partition shifting can restore it. Of course you can always shift the partition by 1TB from the beginning of the disk loosing exactly 1TB of user capacity.
 

Whaaat

Active Member
Jan 31, 2020
316
169
43
however the Seagate ones seems to be stuck at 9.93 TB no matter what I try.
Are those Seagates secure SED or TCG models? I've seen security capable disks that were not using the entire LBA range available reporting smaller size than they should. SeaChest is usually capable of resolving this issue if the firmware is not completely locked out to the 528b sector size.

Databand.PNG
 
Last edited:

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
If disk is already formatted with reduced LBA count no partition shifting can restore it. Of course you can always shift the partition by 1TB from the beginning of the disk loosing exactly 1TB of user capacity.
thats right, you gotta pre-set it correctly (either using low level tools like seatools for seagate or testdisk and such, and reformat in right way using sg_format with --resize -1 option to re-read the capacity)

// Clarification the resize count=-1
-count=-1 causes the block count to be set back to the manufacturer's maximum recommended value.


Are those Seagates secure SED or TCG models? I've seen security capable disks that were using not the entire LBA range available reporting smaller size that they should. SeaChest is usually capable of resolving this issue if the firmware is not completely locked out to the 528b sector size.

View attachment 29692
sg_format typically resolves those with --six, and --pie options, (but obviously seachest is best tool for seagate disks.)
 
Last edited:

BackupProphet

Well-Known Member
Jul 2, 2014
1,096
660
113
Stavanger, Norway
olavgg.com
They are not secured, and works fine.
I've been playing around with openseachest, but without any results.
I have tried
Code:
openSeaChest_Format --device /dev/sg3 --formatUnit 4096 --fastFormat 0 --formatMaxLBA 2441609216 --confirm this-will-erase-data
But it doesnt work, seems like max lba count is locked to 2424569856 no matter what.
The drives are formatted to 4096 bytes and works fine. Its just that I lose like 5% of the total capacity.
 

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
formatMaxLBA is used to reduce the size, not the other way around.

~> If you can just post all details you can from the seagate disk, and from hgst disk. Its going to be easier to figure out why.
(note, some disks that are 4Kn/AF - do not run at 4096, but 4112, 4160, 4224 -- the geometry of the disk could be different vs HGST)
 
Last edited:
  • Like
Reactions: Pepe

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
it isn't.
// tho this isn't really thread to discuss it here (if you want one - go ahead and create it).

short
1686847667369.png
This is how your data is being written to sectors, and there's much better efficiency with 4k vs 512 - so if you have correctly set up disk to 4kn format. You'll loose less space by inefficiency of the format vs 512.



@BackupProphet
(scroll down to mmtrumpet response)
had similar issue as your own - and resolved it | there are few interesting links in there too
 

BackupProphet

Well-Known Member
Jul 2, 2014
1,096
660
113
Stavanger, Norway
olavgg.com
Ive had tried sg_format but without results. Anyway here is disk information


Code:
sudo smartctl -a /dev/sg4
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-73-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               IBM-ESXS
Product:              ST10000NM002G E
Revision:             NCL4
Compliance:           SPC-5
User Capacity:        9,931,038,130,176 bytes [9.93 TB]
Logical block size:   4096 bytes
LU is fully provisioned
Rotation Rate:        7200 rpm
Form Factor:          3.5 inches
Logical Unit id:      0x5000c500cb34a2b7
Serial number:        ZS505YQR0000C1071B7P
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Thu Jun 15 21:55:01 2023 CEST
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Enabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

Grown defects during certification = 0
Total blocks reassigned during format = 0
Total new blocks reassigned = 0
Power on minutes since format = 1250
Current Drive Temperature:     31 C
Drive Trip Temperature:        65 C

Accumulated power on time, hours:minutes 280:22
Elements in grown defect list: 0

Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:          0        0         0         0          0       2617.395           0
write:         0        0         0         0          0      20446.964           0
verify:        0        0         0         0          0         15.554           0

Non-medium error count:        0

SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]
     Description                              number   (hours)
# 1  Background short  Completed                   -       1                 - [-   -    -]

Long (extended) Self-test duration: 56264 seconds [937.7 minutes]

Code:
sudo ./openSeaChest_Format -d /dev/sg4 --SATInfo
==========================================================================================
 openSeaChest_Format - openSeaChest drive utilities - NVMe Enabled
 Copyright (c) 2014-2023 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
 openSeaChest_Format Version: 3.0.0-4_1_1 X86_64
 Build Date: Jun 14 2023
 Today: Thu Jun 15 21:57:46 2023        User: root
==========================================================================================

/dev/sg4 - ST10000NM002G E - ZS505YQR0000C1071B7P - NCL4 - SCSI
        Vendor ID: IBM-ESXS
        Model Number: ST10000NM002G E
        Serial Number: ZS505YQR0000C1071B7P
        Firmware Revision: NCL4
        World Wide Name: 5000C500CB34A2B7
        Drive Capacity (TB/TiB): 9.93/9.03
        Temperature Data:
                Current Temperature (C): 31
                Highest Temperature (C): 43
                Lowest Temperature (C): 24
        Humidity Data:
                Current Humidity (%): 0
                Highest Humidity (%): 0
                Lowest Humidity (%): 0
        Power On Time:  11 days 16 hours 25 minutes
        Power On Hours: 280.42
        MaxLBA: 2424569855
        Native MaxLBA: Not Reported
        Logical Sector Size (B): 4096
        Physical Sector Size (B): 4096
        Sector Alignment: 0
        Rotation Rate (RPM): 7200
        Form Factor: 3.5"
        Last DST information:
                Time since last DST (hours): 279.42
                DST Status/Result: 0x0
                DST Test run: 0x1
        Long Drive Self Test Time:  15 hours 37 minutes
        Interface speed:
                Port 0 (Current Port)
                        Max Speed (GB/s): 12.0
                        Negotiated Speed (Gb/s): 12.0
                Port 1
                        Max Speed (GB/s): 12.0
                        Negotiated Speed (Gb/s): Not Reported
        Annualized Workload Rate (TB/yr): 1.14
        Total Bytes Read (GB): 1.52
        Total Bytes Written (GB): 34.99
        Encryption Support: Not Supported
        Cache Size (MiB): Not Reported
        Read Look-Ahead: Enabled
        Non-Volatile Cache: Enabled
        Write Cache: Disabled
        SMART Status: Good
        ATA Security Information: Not Supported
        Firmware Download Support: Full, Segmented, Deferred
        Number of Logical Units: 1
        Specifications Supported:
                SPC-5
                SAM-5
                SAS-3
                SPL-3
                SPC-4
                SBC-3
        Features Supported:
                Power Consumption
                Protection Type 1
                Protection Type 2
                Persistent Reservations
                Application Client Logging
                Self Test
                Automatic Write Reassignment [Enabled]
                Automatic Read Reassignment [Enabled]
                EPC
                Informational Exceptions [Mode 6]
                Translate Address
                Seagate Remanufacture
                Seagate In Drive Diagnostics (IDD)
                Format Unit
                Fast Format
                Sanitize
                Storage Element Depopulation
        Adapter Information:
                Adapter Type: PCI
                Vendor ID: 1000h
                Product ID: 005Dh
                Revision: 0002h
Code:
sudo ./openSeaChest_Format -d /dev/sg4 --showSupportedFormats
==========================================================================================
 openSeaChest_Format - openSeaChest drive utilities - NVMe Enabled
 Copyright (c) 2014-2023 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
 openSeaChest_Format Version: 3.0.0-4_1_1 X86_64
 Build Date: Jun 14 2023
 Today: Thu Jun 15 22:00:29 2023        User: root
==========================================================================================

/dev/sg4 - ST10000NM002G E - ZS505YQR0000C1071B7P - NCL4 - SCSI

WARNING: Customer unique firmware may have specific requirements that
         restrict sector sizes on some products. It may not be possible to format/
         fast format to common sizes like 4K or 512B due to these customer requirements.


Supported Logical Block Sizes and Protection Types:
---------------------------------------------------
  * - current device format
PI Key:
  Y - protection type supported at specified block size
  N - protection type not supported at specified block size
  ? - unable to determine support for protection type at specified block size
Relative performance key:
  N/A - relative performance not available.
  Best
  Better
  Good
  Degraded
--------------------------------------------------------------------------------
 Logical Block Size  PI-0  PI-1  PI-2  PI-3  Relative Performance  Metadata Size
--------------------------------------------------------------------------------
                512     Y     ?     ?     N                   N/A            N/A
                520     Y     ?     ?     N                   N/A            N/A
                528     Y     ?     ?     N                   N/A            N/A
*              4096     Y     ?     ?     N                   N/A            N/A
               4112     Y     ?     ?     N                   N/A            N/A
               4160     Y     ?     ?     N                   N/A            N/A
--------------------------------------------------------------------------------
NOTE: Device is not capable of showing all sizes it supports. Only common
      sizes are listed. Please consult the product manual for all supported
      combinations.
NOTE: This device supports protection information (PI) (a.k.a. End to End protection).
        Type 0 - No protection beyond transport protocol
        Type 1 - Logical Block Guard and Logical Block Reference Tag
        Type 2 - Logical Block Guard and Logical Block Reference Tag (except first block)
                 32byte read/write CDBs allowed
      Not all forms of PI are supported on all sector sizes unless otherwise indicated
      in the device product manual.
NOTE: This device supports Fast Format. Fast format is not instantaneous and is used for
      switching between 5xx and 4xxx sector sizes. A fast format may take a few minutes or longer
      but may take longer depending on the size of the drive. Fast format support does not necessarily
      mean switching sector sizes AND changing PI at the same time is supported. In most cases, a
      switch of PI type will require a full device format.
      Fast format mode 1 is typically used to switch from 512 to 4096 block sizes with the current
          PI scheme.
Code:
sudo fdisk -l /dev/sdd
Disk /dev/sdd: 9.03 TiB, 9931038130176 bytes, 2424569856 sectors
Disk model: ST10000NM002G E
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 

BackupProphet

Well-Known Member
Jul 2, 2014
1,096
660
113
Stavanger, Norway
olavgg.com
Code:
sudo sg_readcap -l /dev/sg4
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Logical block provisioning: lbpme=0, lbprz=0
   Last LBA=2424569855 (0x9083ffff), Number of logical blocks=2424569856
   Logical block length=4096 bytes
   Logical blocks per physical block exponent=0
   Lowest aligned LBA=0
Hence:
   Device size: 9931038130176 bytes, 9470976.0 MiB, 9931.04 GB, 9.93 TB
 

Whaaat

Active Member
Jan 31, 2020
316
169
43
This is how your data is being written to sectors, and there's much better efficiency with 4k vs 512 - so if you have correctly set up disk to 4kn format. You'll loose less space by inefficiency of the format vs 512.
Yep, the length of the sectors on the platters will be different for 512n and 4kn, hence different read speed, but the resulting capacity is made equal by the manufacturer. And you cannot reformat 512n drive into 4k and vice versa.
For 512e even the physical layout of sectors is identical to 4kn - hence both capacity and speed will be the same.

512_4096.PNG
 

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
Code:
sudo sg_readcap -l /dev/sg4
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Logical block provisioning: lbpme=0, lbprz=0
   Last LBA=2424569855 (0x9083ffff), Number of logical blocks=2424569856
   Logical block length=4096 bytes
   Logical blocks per physical block exponent=0
   Lowest aligned LBA=0
Hence:
   Device size: 9931038130176 bytes, 9470976.0 MiB, 9931.04 GB, 9.93 TB
person from link writes he ran this format (took him 12h to complete)

to reformat and remove protection bits
sg_format --format --fmtpinfo=0 /dev/sg4

to resize drives
sg_format --resize --count=-1 /dev/sXX


Have you done so?
 

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
Yep, the length of the sectors on the platters will be different for 512n and 4kn, hence different read speed, but the resulting capacity is made equal by the manufacturer. And you cannot reformat 512n drive into 4k and vice versa.
For 512e even the physical layout of sectors is identical to 4kn - hence both capacity and speed will be the same.

View attachment 29698
from logical point yes.
It becomes different case when you actually write partition table, and write data.

For each 512 byte sector you will be wasting around 65ish extra bytes (for gap,sync,address,ecc)
so if you happen to write just 4Kb of data with 512 byte sectors, you will actually have to use 4616 bytes.

to write 4Kb of data in 4Kn you will actually write 4211 bytes.
This is where the efficiency goes up from 88% to 97%. Why you can fit more on 4Kn
~ (obviously depends on your files)

Now if you do that at grand scale, if you would ever fill whole disk with files that fit nicely, and fill whole every sector) a 4TB disk with 512 byte sectors would loose around 400ish GB of total logical space in your format. With 4Kn it'd be closer to 150-200GB lost.
 
Last edited:

CyklonDX

Well-Known Member
Nov 8, 2022
857
282
63
Yes, still shows 9.93TB.
bit amazing how fast its going for you - while it took whole day for me to do a single disk.

We can exclude the logical block guard / reference tags. Security is turned off.

// i'll think about it; there are some other options available in sg_format and seachest tools. If i recall there was something you could do from seacheast tools, and lastly there is firmware flash. If you feel like adventure you could try testdisk.