# Hard Drive size limit

## dTr

I have just added a WD caviar green 2tb drive to my system and it only shows 137GB as usable -

```
Disk /dev/sdb: 137.4 GB, 137437871104 bytes

255 heads, 63 sectors/track, 16709 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000aae60

```

This matches the info from the bios. I thought the bios information did not matter once linux had taken control of the system.

Strangely my other hard drive is 250GB and shows the full size as available.

```
Disk /dev/sda: 251.0 GB, 250999111168 bytes

255 heads, 63 sectors/track, 30515 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x12011200
```

Both drives are sata.

Any ideas?

----------

## Veldrin

You may have hit the old LBA Bug which sees the hdd as 128GiB (== 137GB) only. Though I though, this would only affect IDE drives...

What mainboard and BIOS are you using? is there an update available and installed?

V.

----------

## aCOSwt

If I recall correctly, the size limit for a single EXT4 fs is around 16TB...

So...

How was your HD formatted ?

----------

## dTr

The new hdd isnt formatted yet but only 137 is available.

I thought it might be the bios but surely my 250 gb drive would be affected too - they are both sata.

I havent got access to the system at the moment to check the bios version

----------

## Veldrin

The output looks more like fdisk - which does not care about filesystems. (But I should leave that to the OP to answer)

Even ext3 should support 2TB.

And for EXT4 it is 1EiB, 16TiB per file...  :Rolling Eyes: 

----------

## dTr

sorry, i should have said that the output was from fdisk

----------

## drescherjm

Are you sure that is the correct disk?

hdparm -I /dev/sdb

smartctl --all /dev/sdb

----------

## dTr

It is the correct disk - 

```
# hdparm -I /dev/sdb

/dev/sdb:

ATA device, with non-removable media

   Model Number:       WDC WD20EARS-00MVWB0                    

   Serial Number:      WD-WMAZA1235405

   Firmware Revision:  51.0AB51

   Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6

Standards:

   Supported: 8 7 6 5 

   Likely used: 8

Configuration:

   Logical      max   current

   cylinders   16383   16383

   heads      16   16

   sectors/track   63   63

   --

   CHS current addressable sectors:   16514064

   LBA    user addressable sectors:  268433342

   LBA48  user addressable sectors:  268433342

   Logical/Physical Sector size:           512 bytes

   device size with M = 1024*1024:      131070 MBytes

   device size with M = 1000*1000:      137437 MBytes (137 GB)

   cache/buffer size  = unknown

Capabilities:

   LBA, IORDY(can be disabled)

   Queue depth: 32

   Standby timer values: spec'd by Standard, with device specific minimum

   R/W multiple sector transfer: Max = 16   Current = 16

   Recommended acoustic management value: 128, current value: 254

   DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 

        Cycle time: min=120ns recommended=120ns

   PIO: pio0 pio1 pio2 pio3 pio4 

        Cycle time: no flow control=120ns  IORDY flow control=120ns

Commands/features:

   Enabled   Supported:

      *   SMART feature set

          Security Mode feature set

      *   Power Management feature set

      *   Write cache

      *   Look-ahead

      *   Host Protected Area feature set

      *   WRITE_BUFFER command

      *   READ_BUFFER command

      *   NOP cmd

      *   DOWNLOAD_MICROCODE

          Power-Up In Standby feature set

      *   SET_FEATURES required to spinup after power up

          SET_MAX security extension

          Automatic Acoustic Management feature set

      *   48-bit Address feature set

      *   Device Configuration Overlay feature set

      *   Mandatory FLUSH_CACHE

      *   FLUSH_CACHE_EXT

      *   SMART error logging

      *   SMART self-test

      *   General Purpose Logging feature set

      *   64-bit World wide name

      *   WRITE_UNCORRECTABLE_EXT command

      *   {READ,WRITE}_DMA_EXT_GPL commands

      *   Segmented DOWNLOAD_MICROCODE

      *   Gen1 signaling speed (1.5Gb/s)

      *   Gen2 signaling speed (3.0Gb/s)

      *   Native Command Queueing (NCQ)

      *   Host-initiated interface power management

      *   Phy event counters

      *   NCQ priority information

          DMA Setup Auto-Activate optimization

      *   Software settings preservation

      *   SMART Command Transport (SCT) feature set

      *   SCT LBA Segment Access (AC2)

      *   SCT Features Control (AC4)

      *   SCT Data Tables (AC5)

          unknown 206[12] (vendor specific)

          unknown 206[13] (vendor specific)

Security: 

   Master password revision code = 65534

      supported

   not   enabled

   not   locked

      frozen

   not   expired: security count

      supported: enhanced erase

   392min for SECURITY ERASE UNIT. 392min for ENHANCED SECURITY ERASE UNIT.

Logical Unit WWN Device Identifier: 50014ee655d12584

   NAA      : 5

   IEEE OUI   : 0014ee

   Unique ID   : 655d12584

Checksum: correct
```

```
# smartctl --all /dev/sdb

smartctl 5.39.1 2010-01-28 r3054 [x86_64-pc-linux-gnu] (local build)

Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===

Device Model:     WDC WD20EARS-00MVWB0

Serial Number:    WD-WMAZA1235405

Firmware Version: 51.0AB51

User Capacity:    137,437,871,104 bytes

Device is:        Not in smartctl database [for details use: -P showall]

ATA Version is:   8

ATA Standard is:  Exact ATA specification draft version not indicated

Local Time is:    Thu Dec 23 23:24:18 2010 GMT

SMART support is: Available - device has SMART capability.

SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

General SMART Values:

Offline data collection status:  (0x84)   Offline data collection activity

               was suspended by an interrupting command from host.

               Auto Offline Data Collection: Enabled.

Self-test execution status:      (   0)   The previous self-test routine completed

               without error or no self-test has ever 

               been run.

Total time to complete Offline 

data collection:        (38580) seconds.

Offline data collection

capabilities:           (0x7b) SMART execute Offline immediate.

               Auto Offline data collection on/off support.

               Suspend Offline collection upon new

               command.

               Offline surface scan supported.

               Self-test supported.

               Conveyance Self-test supported.

               Selective Self-test supported.

SMART capabilities:            (0x0003)   Saves SMART data before entering

               power-saving mode.

               Supports SMART auto save timer.

Error logging capability:        (0x01)   Error logging supported.

               General Purpose Logging supported.

Short self-test routine 

recommended polling time:     (   2) minutes.

Extended self-test routine

recommended polling time:     ( 255) minutes.

Conveyance self-test routine

recommended polling time:     (   5) minutes.

SCT capabilities:           (0x3035)   SCT Status supported.

               SCT Feature Control supported.

               SCT Data Table supported.

SMART Attributes Data Structure revision number: 16

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  1 Raw_Read_Error_Rate     0x002f   100   253   051    Pre-fail  Always       -       0

  3 Spin_Up_Time            0x0027   191   167   021    Pre-fail  Always       -       5408

  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       61

  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0

  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0

  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       10

 10 Spin_Retry_Count        0x0032   100   253   000    Old_age   Always       -       0

 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0

 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       59

192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       53

193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       92

194 Temperature_Celsius     0x0022   111   110   000    Old_age   Always       -       39

196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0

197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0

199 UDMA_CRC_Error_Count    0x0032   200   253   000    Old_age   Always       -       0

200 Multi_Zone_Error_Rate   0x0008   100   253   000    Old_age   Offline      -       0

SMART Error Log Version: 1

No Errors Logged

SMART Self-test log structure revision number 1

No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1

 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS

    1        0        0  Not_testing

    2        0        0  Not_testing

    3        0        0  Not_testing

    4        0        0  Not_testing

    5        0        0  Not_testing

Selective self-test flags (0x0):

  After scanning selected spans, do NOT read-scan remainder of disk.

If Selective self-test is pending on power-up, resume after 0 minute delay.

```

----------

## frostschutz

Out of curiosity can you post the dmesg output as well (for both drives)?

----------

## dTr

Sure -

250 gb drive:

```

[    0.652737] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

[    0.656753] ata1.00: HPA detected: current 490232639, native 490234752

[    0.656764] ata1.00: ATA-7: Maxtor 6B250S0, BANC1B70, max UDMA/133

[    0.656771] ata1.00: 490232639 sectors, multi 16: LBA48 NCQ (not used)

[    0.663753] ata1.00: configured for UDMA/133

[    0.663854] scsi 0:0:0:0: Direct-Access     ATA      Maxtor 6B250S0   BANC PQ: 0 ANSI: 5

[    0.664181] sd 0:0:0:0: [sda] 490232639 512-byte logical blocks: (250 GB/233 GiB)

[    0.664232] sd 0:0:0:0: [sda] Write Protect is off

[    0.664239] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00

[    0.664258] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

[    0.664382]  sda:

[    0.664490] sd 0:0:0:0: Attached scsi generic sg0 type 0

[    0.667218]  sda1 sda2 sda3

[    0.683394] sd 0:0:0:0: [sda] Attached SCSI disk

```

2tb drive:

```

[    1.118022] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

[    1.175230] ata2.00: HPA detected: current 268433342, native 3907029168

[    1.175240] ata2.00: ATA-8: WDC WD20EARS-00MVWB0, 51.0AB51, max UDMA/133

[    1.175248] ata2.00: 268433342 sectors, multi 16: LBA48 NCQ (depth 0/32)

[    1.197240] ata2.00: configured for UDMA/133

[    1.197338] scsi 1:0:0:0: Direct-Access     ATA      WDC WD20EARS-00M 51.0 PQ: 0 ANSI: 5

[    1.197570] sd 1:0:0:0: [sdb] 268433342 512-byte logical blocks: (137 GB/127 GiB)

[    1.197620] sd 1:0:0:0: [sdb] Write Protect is off

[    1.197628] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00

[    1.197647] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

[    1.197772]  sdb:

[    1.197928] sd 1:0:0:0: Attached scsi generic sg1 type 0

[    1.211835]  sdb1

[    1.212087] sd 1:0:0:0: [sdb] Attached SCSI disk

```

----------

## frostschutz

Okay, that's not detected correctly. No way around it.

What kind of machine / sata controller are we talking about here? (lspci?)

Any options in BIOS to modify the behaviour of the sata controller? (ahci mode?)

There isn't an old drive emulation jumper on the drive or anything?

----------

## dTr

```
# lspci

00:00.0 Memory controller: nVidia Corporation CK804 Memory Controller (rev a3)

00:01.0 ISA bridge: nVidia Corporation CK804 ISA Bridge (rev a3)

00:01.1 SMBus: nVidia Corporation CK804 SMBus (rev a2)

00:02.0 USB Controller: nVidia Corporation CK804 USB Controller (rev a2)

00:02.1 USB Controller: nVidia Corporation CK804 USB Controller (rev a3)

00:04.0 Multimedia audio controller: nVidia Corporation CK804 AC'97 Audio Controller (rev a2)

00:06.0 IDE interface: nVidia Corporation CK804 IDE (rev a2)

00:07.0 IDE interface: nVidia Corporation CK804 Serial ATA Controller (rev a3)

00:08.0 IDE interface: nVidia Corporation CK804 Serial ATA Controller (rev a3)

00:09.0 PCI bridge: nVidia Corporation CK804 PCI Bridge (rev a2)

00:0a.0 Bridge: nVidia Corporation CK804 Ethernet Controller (rev a3)

00:0b.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)

00:0c.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)

00:0d.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)

00:0e.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

```

there were no bios options except for raid settings. I think there was a jumper for use with xp (one for a single partition, one for multiple partitions and not set for other os)

----------

## frostschutz

Hmmm, strange. It should work especially since the 250GB does work too...

Are you using the AHCI driver (dmesg | grep ahci), if not try using it. Or if you're using it, try using the non-ahci driver. If that still does not help, see if there are any BIOS updates available?

Otherwise you may just have to get yourself another SATA controller...

----------

## chithanh

I could be that your BIOS settings are wrong (drive set to CHS/compatible/non-LBA48 mode). Most BIOSes allow individual settings for the drives.

Also some drives have a 137 GB clip jumper. Maybe it is set for some reason.

----------

## mbar

And also download HDD tool from Samsung (I don't remember its name now) and there should be an option like "reset LBA value to native" -- please do it.

----------

## dTr

I have tried seatools - attempting to reset the size of the drive fails with the suggestion that the drive should be power cycled (which I have tried).

The only documented jumper setting is for winxp mode, I'm not sure what exactly this does but from what i have read it shouldn't be necessary for use in linux.

I have also tried in a more recent motherboard and no matter what settings I use, it always shows the same size. It looks like hpa is enabled for this drive but I cannot disable it with either seatools or hdparm!!!

edit

I should also mention that I have now tried a 1tb drive (seagate) in place of the 2tb drive (WD) and I can access the entire 1tb drive so it is clearly a problem with hpa.

----------

## NeddySeagoon

dTr,

HPA should have been reported in dmesg, if it was there.

-- edit --

My bad

```
 [    1.175230] ata2.00: HPA detected: current 268433342, native 3907029168 
```

 it was there.

and 268433342 sectors is 137437871104 bytes.

The kernel does see the LBA48 number 3907029168 sectors or 2000398934016B So its all consistent.

-- end edit --

Drives that support LBA48 - thats all drives bigger than 128Gib (137G) report 137G in the normal place and ther true sice in the LBA48 area, in response to the identify command from the kernel. Drives that do not support LBA48 return zero here.

It would be nice to send the drive an identify command, then examine the 512B response block. Unforunately, I don't know how to do that.

The WinXP mode jumper allows the controller chip to operate in a slow IDE compatible mode, to enable WinXP users to install the AHCI driver, which is not a part of WinXP. Its not needed for Linux. Its not needed for Windows either after the AHCI driver is installed.

----------

