# harddrive not responding [solved]

## SandStar

I've just installed Gentoo on my notebook (Asus A6F) and most things went smoothly except for my harddisk performance.

It just doesnt respond every now and then. I've got the notebook to dualboot with windows xp and windows has no problem with the disk. That should rule out hardware problems.

Relevant dmesg output:

```

[ 1768.002197] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[ 1768.002220] ata1.01: cmd a0/00:00:00:00:00/00:00:00:00:00/b0 tag 0

[ 1768.002223]          cdb 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00

[ 1768.002226]          res 40/00:03:00:00:00/00:00:00:00:00/b0 Emask 0x4 (timeout)

[ 1768.002233] ata1.01: status: { DRDY }

[ 1773.051038] ata1: link is slow to respond, please be patient (ready=0)

[ 1778.049038] ata1: device not ready (errno=-16), forcing hardreset

[ 1778.049053] ata1: soft resetting link

[ 1778.247595] ata1.00: configured for UDMA/100

[ 1778.288320] ata1.01: configured for UDMA/33

[ 1778.291452] ata1: EH complete

```

The above message repeats every time my harddisk becomes unresponsive and the harddisk becomes inaccessible for 10-15 seconds.

lspci:

```

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)

00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)

00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)

02:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

03:01.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b3)

03:01.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 08)

03:01.2 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 17)

03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 08)

03:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

```

hdparm:

```

/dev/sda:

 Model=HTS421280H9AT00, FwRev=HA3OA70S, SerialNo=HKA514AMHHE67E

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

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

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

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

 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-7 T13 1532D revision 1:  ATA/ATAPI-2,3,4,5,6,7

```

And from time to time I get reasonable performance:

```

 hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   2232 MB in  2.00 seconds = 1116.63 MB/sec

 Timing buffered disk reads:   94 MB in  3.01 seconds =  31.21 MB/sec

```

Don't know if it's relevant but here's some more

```

#sdparm -d /dev/sda

    /dev/sda: ATA       HTS421280H9AT00   HA3O

Read write error recovery mode page:

  AWRE        1

  ARRE        0

  PER         0

Caching (SBC) mode page:

  WCE         1

  RCD         0

Control mode page:

  SWP         0

# hdparm -d /dev/sda

/dev/sda:

 HDIO_GET_DMA failed: Inappropriate ioctl for device

```

I'm a bit lost now   :Sad: Last edited by SandStar on Sun Dec 13, 2009 1:02 pm; edited 1 time in total

----------

## d2_racing

Hi, which version of the kernel are you using ?

----------

## SandStar

 :Embarassed:  forgot to mention

I'm using 2.6.31-gentoo-r6

----------

## NeddySeagoon

SandStar,

Set your kernel like this if its not already and ensure your have preemtion set for low latency desktop.

----------

## SandStar

 *NeddySeagoon wrote:*   

> SandStar,
> 
> Set your kernel like this if its not already and ensure your have preemtion set for low latency desktop.

 

I've checked that list and my kernel is already set to those specifications...

----------

## NeddySeagoon

SandStar,

... and the preemtion too ?

----------

## SandStar

 *NeddySeagoon wrote:*   

> SandStar,
> 
> ... and the preemtion too ?

 

yep

----------

## NeddySeagoon

SandStar,

OK, thats all the easy things to detect and fix, now it gets harder.  Run top in an xwindow then provoke the condition.

Look at the third line.

```
Cpu(s):  1.3%us,  0.2%sy,  0.0%ni, 98.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
```

Thats % of CPU time for USer, SYstem, NIce, WAiting ....  don't know the others.

A high amount of wa(iting) time is a bad thing.

Also look at the llnes just below

```
Mem:   8187380k total,  1185712k used,  7001668k free,   137548k buffers

Swap:  2088416k total,        0k used,  2088416k free,   479420k cached
```

Swap need not be zero but it should be fairly static. Swapping will slow things to a crawl and may indicate a lack of RAM for the applications you want to run.

Does top show the amount of RAM you expected? 

```
Mem:   8187380k total
```

is what I get for 8G with a 64 bit kernel

----------

## SandStar

```

top - 22:25:41 up 42 min,  3 users,  load average: 0.32, 0.32, 0.39

Tasks: 119 total,   1 running, 116 sleeping,   0 stopped,   2 zombie

Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 10.3%id, 89.6%wa,  0.0%hi,  0.0%si,  0.0%st

Mem:   2062556k total,   737772k used,  1324784k free,    84332k buffers

Swap:   530104k total,        0k used,   530104k free,   458544k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND

 4878 erwin     20   0  430m  47m  17m S    0  2.4   0:04.18 nepomukservices

 8869 erwin     20   0  2360 1172  872 R    0  0.1   0:00.27 top

    1 root      20   0  1672  564  496 S    0  0.0   0:00.36 init

    2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd

```

This is a few seconds after harddisk locks...

The amount of ram is correct: 2GB

And after a while it is gone and top shows this:

```

top - 22:28:23 up 45 min,  3 users,  load average: 0.26, 0.52, 0.47

Tasks: 119 total,   2 running, 115 sleeping,   0 stopped,   2 zombie

Cpu(s):  0.8%us,  0.8%sy,  0.0%ni, 98.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

Mem:   2062556k total,   736552k used,  1326004k free,    84608k buffers

Swap:   530104k total,        0k used,   530104k free,   456428k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND

 8887 erwin     20   0 55400  16m  13m S    3  0.8   0:03.83 kappfinder

  295 root      15  -5     0    0    0 S    0  0.0   0:00.70 ata/0

 8909 erwin     20   0  2360 1168  872 R    0  0.1   0:00.22 top

    1 root      20   0  1672  564  496 S    0  0.0   0:00.36 init

```

----------

## SandStar

I've just realized that "ata1.01" is the device that is giving problems.   :Shocked: 

That's my dvd drive!

```

[    0.378618] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14

[    0.378696] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15

[    0.379030] ata2: port disabled. ignoring.

[    0.570617] ata1.00: ATA-7: HTS421280H9AT00, HA3OA70S, max UDMA/100

[    0.570694] ata1.00: 156301488 sectors, multi 16: LBA48 

[    0.570808] ata1.01: ATAPI: TSSTcorpCD/DVDW TS-L632D, AS05, max UDMA/33

```

So the problem is with my dvd drive being reset every now and then?

There's no disk in it... I've just put one in to see if that changes anything.

also; what is that thing with changing "configured for" ? UDMA/33 UDMA/25 UDMA/25:PIO4 PIO4... ?

```

dmesg | grep ata1.01

[    0.570808] ata1.01: ATAPI: TSSTcorpCD/DVDW TS-L632D, AS05, max UDMA/33

[    0.634265] ata1.01: configured for UDMA/33

[  513.158853] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[  513.158861] ata1.01: ST_FIRST: !(DRQ|ERR|DF)

[  513.158878] ata1.01: cmd a0/00:00:00:00:00/00:00:00:00:00/b0 tag 0

[  513.158889] ata1.01: status: { DRDY }

[  513.398380] ata1.01: configured for UDMA/33

[ 1782.000090] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[ 1782.000111] ata1.01: cmd a0/00:00:00:00:00/00:00:00:00:00/b0 tag 0

[ 1782.000122] ata1.01: status: { DRDY }

[ 1792.272284] ata1.01: configured for UDMA/33

[ 1837.000091] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[ 1837.000113] ata1.01: cmd a0/00:00:00:08:00/00:00:00:00:00/b0 tag 0 pio 16392 in

[ 1837.000125] ata1.01: status: { DRDY }

[ 1847.288337] ata1.01: configured for UDMA/33

[ 1934.000225] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[ 1934.000244] ata1.01: cmd a0/00:00:00:00:00/00:00:00:00:00/b0 tag 0

[ 1934.000256] ata1.01: status: { DRDY }

[ 1944.286333] ata1.01: configured for UDMA/33

[ 1990.000088] ata1.01: limiting speed to UDMA/25:PIO4

[ 1990.000098] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[ 1990.000117] ata1.01: cmd a0/00:00:00:00:00/00:00:00:00:00/b0 tag 0

[ 1990.000128] ata1.01: status: { DRDY }

[ 2000.289339] ata1.01: configured for UDMA/25

[ 2312.000095] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[ 2312.000117] ata1.01: cmd a0/00:00:00:08:00/00:00:00:00:00/b0 tag 0 pio 16392 in

[ 2312.000129] ata1.01: status: { DRDY }

[ 2322.287321] ata1.01: configured for UDMA/25

[ 2601.000084] ata1.01: limiting speed to PIO4

[ 2601.000094] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[ 2601.000112] ata1.01: cmd a0/00:00:00:00:00/00:00:00:00:00/b0 tag 0

[ 2601.000124] ata1.01: status: { DRDY }

[ 2611.286321] ata1.01: configured for PIO4

[ 2973.000083] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen

[ 2973.000103] ata1.01: cmd a0/00:00:00:00:00/00:00:00:00:00/b0 tag 0

[ 2973.000114] ata1.01: status: { DRDY }

[ 2983.286321] ata1.01: configured for PIO4

```

----------

## NeddySeagoon

SandStar,

```
Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 10.3%id, 89.6%wa,  0.0%hi,  0.0%si,  0.0%st 
```

shows that the CPU is busy waiting for something 89.6% of the time - thats bad.

```
[    0.570617] ata1.00: ATA-7: HTS421280H9AT00, HA3OA70S, max UDMA/100
```

 is an 80G IDE UDMA capabale drive that supports data transfer rates over the IDE cable of 100Mb/sec. Thats the UDMA/100.

The 

```
[    0.570808] ata1.01: ATAPI: TSSTcorpCD/DVDW TS-L632D, AS05, max UDMA/33 
```

tells that your CD is UDMA but only cpable of 33Mb/sec data rate over the interface.  These days both drives will be operated at their own speeds. Your HDD will not sustain 100Mb/sec either as the sustained data rate will be determined by the head/platter data rate. Google says its a 2.5 4200RPM IDE HDD drive, so 40Mb/sec is doing well.

Both your HDD and CDROM are on the same IDE bus. This is a bad thing as only one device on an IDE cable can be active at any time, so when the kernel is talking to your CDROM and waiting for a response, it cannot talk to the hard drive.  Normally the CDROM is polled every 2 seconds to determine its media changed status. (Only a few broken drives actually need this). When there is a problem - the IDE bus is not available to the HDD.

The dmesg does not mean the CDROM is defective - just that there are issues there somewhere.

----------

## aCOSwt

Your problem is within the firmware of your DVD.

Explanation & solution should be there :

https://bugs.launchpad.net/linux/+bug/75295/comments/97

----------

## SandStar

 *aCOSwt wrote:*   

> Your problem is within the firmware of your DVD.
> 
> Explanation & solution should be there :
> 
> https://bugs.launchpad.net/linux/+bug/75295/comments/97

 

Thanks! It's running fine now  :Smile: 

----------

