# Hard drive read is slow, write seems OK

## Korhul

Hi,

I have recently experianced strange behaviour of my laptop's hard drive. Because of lack of free space I needed to resize some partition's (two with ext3 and one with reiserfs). I backed up all the data, deleted the partitions, recreated them and put data back. However now the system starts very slow, all the programs load quite a long time, even Windows performance has been retarded the same way.

My laptop is HP nx6325 with Sempron 3500+, 1GB of RAM and 250 GB (5400 rpm) HDD Scorpio SATA drive.

Hdparm shows, that dma is enabled.

```

hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media

        Model Number:       WDC WD2500BEVS-00UST0

        Serial Number:      WD-WXE108106542

        Firmware Revision:  01.01A01

Standards:

        Supported: 8 7 6 5

        Likely used: 8

Configuration:

        Logical         max     current

        cylinders       16383   17475

        heads           16      15

        sectors/track   63      63

        --

        CHS current addressable sectors:   16513875

        LBA    user addressable sectors:  268435455

        LBA48  user addressable sectors:  488397168

        device size with M = 1024*1024:      238475 MBytes

        device size with M = 1000*1000:      250059 MBytes (250 GB)

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

        Advanced power management level: disabled

        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

                Advanced Power Management feature set

                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

           *    WRITE_{DMA|MULTIPLE}_FUA_EXT

           *    64-bit World wide name

           *    IDLE_IMMEDIATE with UNLOAD

           *    Segmented DOWNLOAD_MICROCODE

           *    SATA-I signaling speed (1.5Gb/s)

           *    Native Command Queueing (NCQ)

           *    Host-initiated interface power management

           *    Phy event counters

                DMA Setup Auto-Activate optimization

                Device-initiated interface power management

           *    Software settings preservation

           *    SMART Command Transport (SCT) feature set

           *    SCT Long Sector Access (AC1)

           *    SCT LBA Segment Access (AC2)

           *    SCT Error Recovery Control (AC3)

           *    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

        not     supported: enhanced erase

        92min for SECURITY ERASE UNIT.

Logical Unit WWN Device Identifier: 50014ee2564f2027

        NAA             : 5

        IEEE OUI        : 14ee

        Unique ID       : 2564f2027

Checksum: correct

```

Testing speed with hdparm on the /dev/sda gives nice values:

```
/dev/sda:

 Timing cached reads:   662 MB in  2.00 seconds = 330.79 MB/sec

 Timing buffered disk reads:  168 MB in  3.01 seconds =  55.84 MB/sec
```

But when I test partitions:

```

/dev/sda8:

 Timing cached reads:   704 MB in  2.00 seconds = 351.69 MB/sec

 Timing buffered disk reads:  116 MB in  5.20 seconds =  22.32 MB/sec

ctibor@alwaid # hdparm -tT /dev/sda8

/dev/sda8:

 Timing cached reads:   680 MB in  2.00 seconds = 339.96 MB/sec

 Timing buffered disk reads:  118 MB in 15.65 seconds =   7.54 MB/sec

```

```

alwaid ctibor # hdparm -tT /dev/sda7

/dev/sda7:

 Timing cached reads:   742 MB in  2.00 seconds = 371.00 MB/sec

 Timing buffered disk reads:   22 MB in  9.31 seconds =   2.36 MB/sec

alwaid ctibor # hdparm -tT /dev/sda7

/dev/sda7:

 Timing cached reads:   886 MB in  2.00 seconds = 442.87 MB/sec

 Timing buffered disk reads:   20 MB in  3.05 seconds =   6.55 MB/sec

```

```

alwaid ctibor # hdparm -tT /dev/sda6

/dev/sda6:

 Timing cached reads:   852 MB in  2.00 seconds = 425.72 MB/sec

 Timing buffered disk reads:   74 MB in  9.65 seconds =   7.67 MB/sec

alwaid ctibor # hdparm -tT /dev/sda6

/dev/sda6:

 Timing cached reads:   830 MB in  2.00 seconds = 414.81 MB/sec

 Timing buffered disk reads:   76 MB in 12.81 seconds =   5.93 MB/sec

```

As I know, that hdparm isn't the perfect benchmark (something like glxgears for gfx cards  :Wink: ) I turned my focus to piozone. I must admit that I don't fully understand what this benchmark is doing but I can see some performance drops when I perform it:

```

alwaid ctibor # piozone -vd -t 10 /dev/sda

[PIOZONE, version 1.0 - Copyright (c) 2002 Peter Eriksson <pen@lysator.liu.se>]

Disk size: 206 GB (192 GiB)

Linear read transfer rates:

25.4 MB/s at offset   0 GB using  64 KiB reads

 0.3 MB/s at offset 102 GB using  64 KiB reads

34.8 MB/s at offset 205 GB using  64 KiB reads

 0.5 MB/s at offset 307 GB using  64 KiB reads

 8.0 MB/s at offset 410 GB using  64 KiB reads

17.6 MB/s at offset 512 GB using  64 KiB reads

24.5 MB/s at offset 615 GB using  64 KiB reads

30.9 MB/s at offset 717 GB using  64 KiB reads

26.9 MB/s at offset 820 GB using  64 KiB reads

25.1 MB/s at offset 922 GB using  64 KiB reads

 4.1 MB/s at offset 1025 GB using  64 KiB reads

 0.8 MB/s at offset 1127 GB using  64 KiB reads

 0.5 MB/s at offset 1230 GB using  64 KiB reads

 0.3 MB/s at offset 1333 GB using  64 KiB reads

 0.2 MB/s at offset 1435 GB using  64 KiB reads

 0.5 MB/s at offset 1538 GB using  64 KiB reads

 0.4 MB/s at offset 1640 GB using  64 KiB reads

 0.3 MB/s at offset 1743 GB using  64 KiB reads

14.0 MB/s at offset 1845 GB using  64 KiB reads

21.7 MB/s at offset 1948 GB using  64 KiB reads

24.5 MB/s at offset 2050 GB using  64 KiB reads

13.8 MB/s at offset 2153 GB using  64 KiB reads

14.8 MB/s at offset 2255 GB using  64 KiB reads

28.0 MB/s at offset 2358 GB using  64 KiB reads

30.8 MB/s at offset 2461 GB using  64 KiB reads

22.9 MB/s at offset 2563 GB using  64 KiB reads

15.8 MB/s at offset 2666 GB using  64 KiB reads

```

And so on... values varies between 30 MB/s to 0.1 MB/s.

When I tried to copy some data between partitions or to the partition itself the speed varied between ~15 MB/s in few seconds of the transfer but mostly it wen't around 0.5 MB/s (measured with KDE and mc). Copying from my desktop to the laptop from NFS share gave nice speed above 10 MB/s (connected with gigabit link). Also copying from optical to the hard drive is normal, thus I assume that only reading is broken. But why and how I can't tell.

Anybody knows where the problem might be?

----------

## eccerr0r

The symptoms are very strange, it points to a dying disk?  Try running smartctl -a (smartmontools) on that disk, and see if it's having issues working with the platters.

----------

## Korhul

```
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     0x000f   172   172   051    Pre-fail  Always       -       9142

  3 Spin_Up_Time            0x0003   189   188   021    Pre-fail  Always       -       1516

  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       248

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

  7 Seek_Error_Rate         0x000f   200   200   051    Pre-fail  Always       -       0

  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       750

 10 Spin_Retry_Count        0x0013   100   100   051    Pre-fail  Always       -       0

 11 Calibration_Retry_Count 0x0012   100   100   051    Old_age   Always       -       0

 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       193

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

193 Load_Cycle_Count        0x0032   194   194   000    Old_age   Always       -       19271

194 Temperature_Celsius     0x0022   097   093   000    Old_age   Always       -       50

196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0

197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0010   100   253   000    Old_age   Offline      -       0

199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

200 Multi_Zone_Error_Rate   0x0009   100   253   051    Pre-fail  Offline      -       0

```

Seems like it is bad for me... But what could cause that this 2 months old disk is in such a bad state. I have't droped it on the ground or like...

----------

## eccerr0r

That actually doesn't show much, is there any read errors in the output, from the logs?

Are the results that you got repeatable?  Sure there's not a software program churning on the disk while doing the benchmarks/operations?

----------

## Korhul

There are no read errors in logs. The symptoms are the same with booting from Gentoo livedvd 2007.0.

The whole smartctl -a

```
alwaid ctibor # smartctl -a /dev/sda

smartctl version 5.37 [x86_64-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===

Device Model:     WDC WD2500BEVS-00UST0

Serial Number:    WD-WXE108106542

Firmware Version: 01.01A01

User Capacity:    250 059 350 016 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:    Wed Jun  4 20:02:31 2008 CEST

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:  (0x00) Offline data collection activity

                                        was never started.

                                        Auto Offline Data Collection: Disabled.

Self-test execution status:      ( 241) Self-test routine in progress...

                                        10% of test remaining.

Total time to complete Offline

data collection:                 (9180) 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:        ( 110) minutes.

Conveyance self-test routine

recommended polling time:        (   5) minutes.

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     0x000f   173   172   051    Pre-fail  Always       -       9153

  3 Spin_Up_Time            0x0003   189   188   021    Pre-fail  Always       -       1516

  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       248

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

  7 Seek_Error_Rate         0x000f   200   200   051    Pre-fail  Always       -       0

  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       753

 10 Spin_Retry_Count        0x0013   100   100   051    Pre-fail  Always       -       0

 11 Calibration_Retry_Count 0x0012   100   100   051    Old_age   Always       -       0

 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       193

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

193 Load_Cycle_Count        0x0032   194   194   000    Old_age   Always       -       19271

194 Temperature_Celsius     0x0022   096   093   000    Old_age   Always       -       51

196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0

197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0010   100   253   000    Old_age   Offline      -       0

199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

200 Multi_Zone_Error_Rate   0x0009   100   253   051    Pre-fail  Offline      -       0

SMART Error Log Version: 1

ATA Error Count: 1

        CR = Command Register [HEX]

        FR = Features Register [HEX]

        SC = Sector Count Register [HEX]

        SN = Sector Number Register [HEX]

        CL = Cylinder Low Register [HEX]

        CH = Cylinder High Register [HEX]

        DH = Device/Head Register [HEX]

        DC = Device Command Register [HEX]

        ER = Error register [HEX]

        ST = Status register [HEX]

Powered_Up_Time is measured from power on, and printed as

DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,

SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 1 occurred at disk power-on lifetime: 659 hours (27 days + 11 hours)

  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:

  ER ST SC SN CL CH DH

  -- -- -- -- -- -- --

  40 51 00 2e be 69 e0  Error: UNC at LBA = 0x0069be2e = 6929966

  Commands leading to the command that caused the error were:

  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name

  -- -- -- -- -- -- -- --  ----------------  --------------------

  25 00 00 2e be 69 03 00      04:31:59.607  READ DMA EXT

  25 00 00 2e ba 69 03 00      04:31:49.721  READ DMA EXT

  25 00 00 2e b6 69 03 00      04:31:37.029  READ DMA EXT

  25 00 00 2e b2 69 03 00      04:31:30.607  READ DMA EXT

  25 00 00 2e ae 69 03 00      04:31:25.904  READ DMA EXT

SMART Self-test log structure revision number 1

Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error

# 1  Short offline       Aborted by host               10%       751         -

# 2  Short captive       Interrupted (host reset)      90%       750         -

# 3  Short offline       Aborted by host               80%       750         -

# 4  Short offline       Aborted by host               90%       750         -

# 5  Short offline       Aborted by host               50%       750         -

# 6  Extended offline    Aborted by host               10%       743         -

# 7  Short offline       Completed without error       00%       733         -

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.
```

----------

