# HDD too slow (~1.2 MB/s - DMA ON)|PLZ HELP

## dinsmore

Hi, I've been having problems with my hdd for quite a while now, and I wanted to know if someone could please help me through...  My problem is that when I do an hdparm -tT /dev/hda it returns very low numbers... DMA is on, and I have the propper chipset drivers built in my kernel (2.6.15), so I;m guessing it may be a missconfiguration problem, maybe some switches from hdparm.

The Strangest thing is that it used to run at least at 20 MB/s (just at hdparm -t, but usually it worked at 10 MB/s or worst), but now it returns about 1 MB/s o sometimes even less...

Here are some info you should find helpful:

```
nirvana ~ # uname -a

Linux nirvana 2.6.15 #2 SMP PREEMPT Sun Jan 8 14:11:28 GMT 2006 i686 Mobile Intel(R) Celeron(R) CPU 1.60GHz GenuineIntel GNU/Linux
```

```
nirvana ~ # hdparm -i /dev/hda

/dev/hda:

 Model=IC25N060ATMR04-0, FwRev=MO3OAD4A, SerialNo=MRA301K5V5MUZH

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4

 BuffType=DualPortCache, BuffSize=7884kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=117210240

 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4 

 DMA modes:  mdma0 mdma1 mdma2 

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 

 AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled

 Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a: 

 * signifies the current active mode

```

```
nirvana ~ # hdparm -I /dev/hda

/dev/hda:

ATA device, with non-removable media

        Model Number:       IC25N060ATMR04-0                        

        Serial Number:      MRA301K5V5MUZH

        Firmware Revision:  MO3OAD4A

Standards:

        Used: ATA/ATAPI-6 T13 1410D revision 3a 

        Supported: 6 5 4 3 

Configuration:

        Logical         max     current

        cylinders       16383   65535

        heads           16      1

        sectors/track   63      63

        --

        CHS current addressable sectors:    4128705

        LBA    user addressable sectors:  117210240

        LBA48  user addressable sectors:  117210240

        device size with M = 1024*1024:       57231 MBytes

        device size with M = 1000*1000:       60011 MBytes (60 GB)

Capabilities:

        LBA, IORDY(can be disabled)

        bytes avail on r/w long: 4      Queue depth: 1

        Standby timer values: spec'd by Vendor, no device specific minimum

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

        Advanced power management level: 128 (0x80)

        Recommended acoustic management value: 128, current value: 254

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

             Cycle time: min=120ns recommended=120ns

        PIO: pio0 pio1 pio2 pio3 pio4 

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

Commands/features:

        Enabled Supported:

           *    NOP cmd

           *    READ BUFFER cmd

           *    WRITE BUFFER cmd

           *    Host Protected Area feature set

           *    Look-ahead

           *    Write cache

           *    Power Management feature set

                Security Mode feature set

           *    SMART feature set

           *    FLUSH CACHE EXT command

           *    Mandatory FLUSH CACHE command 

           *    Device Configuration Overlay feature set 

           *    48-bit Address feature set 

                Automatic Acoustic Management feature set 

                SET MAX security extension

                Address Offset Reserved Area Boot

           *    SET FEATURES subcommand required to spinup after power up

                Power-Up In Standby feature set

           *    Advanced Power Management feature set

           *    General Purpose Logging feature set

           *    SMART self-test 

           *    SMART error logging 

Security: 

        Master password revision code = 65534

                supported

        not     enabled

        not     locked

                frozen

        not     expired: security count

        not     supported: enhanced erase

        50min for SECURITY ERASE UNIT. 

HW reset results:

        CBLID- above Vih

        Device num = 0 determined by the jumper

Checksum: correct

```

```
nirvana ~ # hdparm /dev/hda

/dev/hda:

 multcount    = 16 (on)

 IO_support   =  1 (32-bit)

 unmaskirq    =  0 (off)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 16383/255/63, sectors = 60011642880, start = 0

```

```
nirvana ~ # hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   840 MB in  2.00 seconds = 419.14 MB/sec

 Timing buffered disk reads:    4 MB in  3.30 seconds =   1.21 MB/sec

```

Also, something strange is that when I try hdparm -t /dev/hda3 it returns about 25 MB/s...  :S

```
nirvana ~ # fdisk -l

Disk /dev/hda: 60.0 GB, 60011642880 bytes

255 heads, 63 sectors/track, 7296 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/hda1               1           3       24066   a0  IBM Thinkpad hibernation

/dev/hda2   *           4         513     4096575    7  HPFS/NTFS

/dev/hda3             514        2355    14795865    c  W95 FAT32 (LBA)

/dev/hda4            2356        7296    39688582+   f  W95 Ext'd (LBA)

/dev/hda5            2356        2420      522081   82  Linux swap

/dev/hda6            2421        7296    39166438+  83  Linux

```

```
nirvana ~ # df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/hda6              37G   32G  3.8G  90% /

udev                  172M  120K  172M   1% /dev

/dev/hda3              15G  7.2G  7.0G  51% /hda3

none                  172M     0  172M   0% /dev/shm
```

```
nirvana ~ # hdparm -tT /dev/hda3

/dev/hda3:

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

 Timing buffered disk reads:   78 MB in  3.04 seconds =  25.62 MB/sec
```

```
nirvana ~ # hdparm -tT /dev/hda6

/dev/hda6:

 Timing cached reads:   932 MB in  2.01 seconds = 464.11 MB/sec

 Timing buffered disk reads:   52 MB in  3.10 seconds =  16.79 MB/sec
```

----------

## chrisruwe

Have a look a the discrepancy between cache reads -> decent value and between disk reads -> awful value

It seems not to be a problem concerning the disk, keeping in mind that your other partition is ok, but to be a problem of the partition. This might hint at either a seriously corrupted filesystem or at some bad sectors only on that partition.

You might try fsck-tools and the smart-monitoring-suite, these might give further inforamtion

----------

## dinsmore

Ok, so I've tried running e2fsck from the gentoo live cd. The checking returned that the fs was clean:

```
livecd root # e2fsck /dev/hda6

e2fsck 1.34 (25-Jul-2003)

/dev/hda6: clean, 854332/4879680 files, 8409377/9791609 blocks

```

 But when I tried running e2fsck for bad blocks, this is wat it returned:

```
livecd root # e2fsck -c -c /dev/hda6

e2fsck 1.34 (25-Jul-2003)

Checking for bad blocks (non-destructive read-write test)

Testing with random pattern: hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }

hda: dma_intr: error=0x40 { UncorrectableError }, LBAsect=41305891, sector=2428416

end_request: I/O error, dev 03:06 (hda), sector 2428416

hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }

hda: dma_intr: error=0x40 { UncorrectableError }, LBAsect=41305892, sector=2428424

end_request: I/O error, dev 03:06 (hda), sector 2428424

hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }

hda: dma_intr: error=0x40 { UncorrectableError }, LBAsect=42072757, sector=3195272

end_request: I/O error, dev 03:06 (hda), sector 3195272

....

........

and it went on an on with the same errors.

```

Now, the speed has improved though it's still slow, but when I try hdparm -t on /dev/hda6 it works fine now, but it's not so well when I try just '/dev/hda'.

```
nirvana ~ # hdparm -t /dev/hda6

/dev/hda6:

 Timing buffered disk reads:   60 MB in  3.02 seconds =  19.84 MB/sec

```

```
nirvana ~ # hdparm -t /dev/hda3

/dev/hda3:

 Timing buffered disk reads:   76 MB in  3.00 seconds =  25.33 MB/sec

```

```
nirvana ~ # hdparm -t /dev/hda 

/dev/hda:

 Timing buffered disk reads:    6 MB in  3.83 seconds =   1.57 MB/sec

```

:S :S :S

I can't seem to understand why the big difference... :S  is it an average from all the partitions ? maybe it has something to do with hda2 being very slow too:

```
nirvana ~ # hdparm -t /dev/hda2

/dev/hda2:

 Timing buffered disk reads:    4 MB in  3.06 seconds =   1.31 MB/sec

```

(hda2 == ntfs partition, 4GB)

----------

## chrisruwe

you might try a 

```
time hdparm -tT /dev/hdx
```

 - could the ntfs-partition use lots of cpu power due to the kernel driver dev-status? Could the cpu cause the bottleneck?

----------

## dinsmore

Why would it be consuming a lot of CPU-power? I almost never use that partition, and I don't have it mounted generally...

What do you mean with the 'kernel driver dev-status'? Sorry for my bad english, but I can't understand waht you mean with 'the bottleneck'...

Here are the results of 'time hdparm -tT /dev/hda', /dev/hda6, /dev/hda3 and hda2.

```
nirvana ~ # time hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   1000 MB in  2.00 seconds = 499.97 MB/sec

 Timing buffered disk reads:    6 MB in  4.16 seconds =   1.44 MB/sec

real    0m15.366s

user    0m0.284s

sys     0m1.780s

nirvana ~ # time hdparm -tT /dev/hda6

/dev/hda6:

 Timing cached reads:   992 MB in  2.00 seconds = 494.98 MB/sec

 Timing buffered disk reads:   54 MB in  3.11 seconds =  17.35 MB/sec

real    0m13.399s

user    0m0.180s

sys     0m2.140s

nirvana ~ # time hdparm -tT /dev/hda3

/dev/hda3:

 Timing cached reads:   976 MB in  2.00 seconds = 488.95 MB/sec

 Timing buffered disk reads:   78 MB in  3.04 seconds =  25.66 MB/sec

real    0m13.306s

user    0m0.276s

sys     0m2.644s

nirvana ~ # time hdparm -tT /dev/hda2

/dev/hda2:

 Timing cached reads:   928 MB in  2.00 seconds = 463.97 MB/sec

 Timing buffered disk reads:    2 MB in  5.94 seconds = 344.53 kB/sec

real    0m21.329s

user    0m0.192s

sys     0m1.828s

```

Look at the fdisk -l that I posted in my first post. There are a lot of partitions that I don't use, like hda1 for example, I don't even know what that partition is for... :S  And hda4, I don't use that partition either...My partitions are: hda2[ntfs], hda3[FAT32], hda5[swap] and hda6[ext3]... 

Maybe I need to erase the partitions that I don't need...

----------

## Corona688

It is DYING.  Stop worrying about how slow it is and get your data off, stat!  Modern drives don't get bad sectors until they're on death's door -- they've got this internal sector-remapping magic that hides them, you only see them once they run out of spares.

Install a new hard drive of equal or greater capacity, boot from a liveCD, then 

```
dd if=/dev/INPUT of=/dev/OUTPUT conv=noerror,sync
```

 That conv=noerror,sync bit is important -- without it, when it hits a bad sector, instead of writing a sector full of zeroes onto /dev/OUTPUT, it'll just write nothing, not even skipping the sector.  Throwing an entire filesystem off by a single sector somewhere in the middle can have interesting side-effects  :Very Happy: 

Whatever filesystem you have on the drive shouldn't matter with respect to drive speed tests, since it's reading the partition directly, not reading files on the partition.  I think it's slowing down when it hits bad sectors.

----------

## dinsmore

Dying ? I can't copy from one hdd to the other one since I'm working on a laptop. The drive is pretty new, bought it last year :S

I ran ntfsfix on /dev/hda2 and now hda2 reads at 15 MB/s aprox, and hdparm on /dev/hda works pretty fine...

```
nirvana ~ # hdparm -tT /dev/hda2

/dev/hda2:

 Timing cached reads:   980 MB in  2.00 seconds = 490.95 MB/sec

 Timing buffered disk reads:   46 MB in  3.06 seconds =  15.05 MB/sec

```

```
nirvana ~ # hdparm -tT /dev/hda 

/dev/hda:

 Timing cached reads:   984 MB in  2.00 seconds = 491.97 MB/sec

 Timing buffered disk reads:   44 MB in  3.08 seconds =  14.30 MB/sec

```

But that was at the begining... I continued trying hdparm's on hda2 and the speed went down pregressively :S Now it works at 5.0 MB/s aprox... :S

This is wierd too:

```
nirvana ~ # ntfslabel /dev/hda2

Volume is dirty.

Run chkdsk and try again, or use the force option.

```

I don't have chkdsk intalled nor is it available for emerge. Maybe it means that I have to boot windows and let it run a check on the FS?

----------

## Corona688

 *dinsmore wrote:*   

> Dying ? I can't copy from one hdd to the other one since I'm working on a laptop.

  If you have or get an external USB IDE drive box, you can.  I do emergency drive-copies with a hard drive in a USB box all the time.  A usb drive would appear as /dev/sd* instead of /dev/hd* but otherwise the dd procedure would be the same. *Quote:*   

> The drive is pretty new, bought it last year :S

  New or not, it is dying.  Healthy drives do not have visible bad sectors.  If you can't back up the drive at least back up your data!  It could stop functioning and/or corrupt your data at any time. *Quote:*   

> I ran ntfsfix on /dev/hda2 and now hda2 reads at 15 MB/s aprox, and hdparm on /dev/hda works pretty fine...

  Irrelevant.  It is dying.  Healthy drives do not have visible bad sectors.  As for the speed increase, I'm guessing the drive is remapping to avoid more bad sectors, but this is NOT a good thing -- this means it's found MORE bad sectors in every partition you managed to speed up!  This can't go on forever.  Sooner or later bad sectors will appear in places it can't correct.  More than the uncorrectable ones you have already, I mean. *Quote:*   

> 
> 
> ```
> nirvana ~ # hdparm -tT /dev/hda2
> 
> ...

  Please stop doing benchmarks!   :Sad:   You should use the time you have left to back up whatever important data you have, not test speed.  It is dying.  It doesn't matter how fast it works.  Running benchmarks on a sick drive is very bad for it. *Quote:*   

> This is wierd too:
> 
> ```
> nirvana ~ # ntfslabel /dev/hda2
> 
> ...

  Step 1:  Back up your data.

Step 2:  Install new hard drive.

Step 3:  Throw away old hard drive.

It is DYING.  You cannot fix the drive, or trust it.  Back up what you have left before it is too late.

----------

## chrismortimore

 *dinsmore wrote:*   

> Dying ? I can't copy from one hdd to the other one since I'm working on a laptop. The drive is pretty new, bought it last year :S
> 
> I ran ntfsfix on /dev/hda2 and now hda2 reads at 15 MB/s aprox, and hdparm on /dev/hda works pretty fine...
> 
> ```
> ...

 

If you boot the WinXP installer disc and go into rescue mode, you'll be able to run chkdsk on the NTFS partition from there.  

But, the drive probably dying.  Do you know the manufactorer of the drive?  They'll provide their own diagnostic utilities, generally they are boot discs (Maxtor have "PowerMax", Western Digital have one as well although the name skips me just now, others will probably have their own as well).  Run that, it'll give you an error code if the drive is broken, and then you'll be able to order a replacement straight from them.  Given the drive is in warranty, you should have little trouble getting a replacement.  Most companies will offer to send the replacement before asking for the old one to give you a chance to copy data from the old to the new drive.

If you can't be bothered reading that, the jist of it is your hard drive will stop working very soon.  And a few more times: your hard drive will stop working very soon your hard drive will stop working very soon your hard drive will stop working very soon your hard drive will stop working very soon your hard drive will stop working very soon your hard drive will stop working very soon.

----------

## Corona688

 *chrismortimore wrote:*   

> Do you know the manufactorer of the drive?  They'll provide their own diagnostic utilities, generally they are boot discs (Maxtor have "PowerMax", Western Digital have one as well although the name skips me just now, others will probably have their own as well).  Run that, it'll give you an error code if the drive is broken, and then you'll be able to order a replacement straight from them.

  ONLY do that once you have backed up your drive!  A warranty won't save your data.

----------

## chrismortimore

I noticed your drive is an IBM Travel Star if that helps.  In my experience, IBM drives are very reliable, so yours was probably faulty to begin with and has slowly warn itself to death over the last year.

Useful backup tools, worth investigating in my option, I use them:

 * partimage - takes an image of a selected partition and saves it as a file (can compress with gzip or bzip2)

 * flexbackup - does incremental backups (can use basically any archiver you want)

 * cp -  :Razz: 

----------

## chrismortimore

 *Corona688 wrote:*   

> ONLY do that once you have backed up your drive!  A warranty won't save your data.

 But that goes without saying, because only silly people don't do regular backups  :Wink: 

----------

## JeliJami

 *dinsmore wrote:*   

> The drive is pretty new, bought it last year :S

 

I've "killed" three (3!) laptop harddisks in less than four months.

All on the same laptop.

The one that's plugged in now, is holding up quite well, for about a year or so.

----------

## chrismortimore

 *davjel wrote:*   

> I've "killed" three (3!) laptop harddisks in less than four months.
> 
> All on the same laptop.

 That'd make me think that maybe the laptop is overvolting them to destruction, and perhaps the latest is more tolerant to it.  Perhaps get out the multimeter?

----------

