# Harddrive: motherboard, driver or FS error ? [SOLVED]

## HeXiLeD

Recently after upgrading my kernel i started to have some write problems with one of my hard drives. (now replaced).

The problem was not always there at every reboot and with every kernel but i made set the drive to stay as read only after sometime.

Then i would have to reboot and the same problem would happen again.

I checked for badblocks and filesystem errors and nothing was found. However the last times i tried to fsck it it became impossible and stalled (while using vanilla-sources 3.0.6).

Details:

```
/etc/fstab

/dev/sdb1               /home           ext3            noatime                  0 1
```

Drive:

WDC WD5000AAKS-0  12.0

# fdisk 

```
Disk /dev/sdb: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors

Units = sectors of 1 * 512 = 512 bytes

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

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

Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1              63   976768064   488384001   83  Linux
```

# hdparm -i /dev/sdb

```
/dev/sdb:

 Model=WDC WD5000AAKS-00TMA0, FwRev=12.01C01, SerialNo=WD-WCAPW3784229

 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }

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

 BuffType=unknown, BuffSize=16384kB, MaxMultSect=16, MultSect=off

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

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

 PIO modes:  pio0 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6

 AdvancedPM=no WriteCache=enabled

 Drive conforms to: Unspecified:  ATA/ATAPI-1,2,3,4,5,6,7

 * signifies the current active mode

```

```
# sdparm -a -vvv /dev/sdb
```

```
>>> about to open device name: /dev/sdb

open /dev/sdb with flags=0x800

    inquiry cdb: 12 00 00 00 24 00

    /dev/sdb: ATA       WDC WD5000AAKS-0  12.0

    mode sense (10) cdb: 5a 00 01 00 00 00 00 00 08 00

    mode sense (10) cdb: 5a 00 01 00 00 00 00 00 1c 00

    mode sense (10) cdb: 5a 00 41 00 00 00 00 00 1c 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

    mode sense (10) cdb: 5a 00 81 00 00 00 00 00 1c 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

    mode sense (10) cdb: 5a 00 c1 00 00 00 00 00 1c 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Saving parameters not supported

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 39 00 00 00

        00 00

Read write error recovery [0x1] mode page [PS=0]:

  AWRE        1

  ARRE        0

  TB          0

  RC          0

  EER         0

  PER         0

  DTE         0

  DCR         0

  RRC         0

  COR_S       0

  HOC         0

  DSOC        0

  WRC         0

  RTL         0

    mode sense (10) cdb: 5a 00 02 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Disconnect-reconnect (SPC + transports) mode page [0x2] not found

    mode sense (10) cdb: 5a 00 03 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Format (SBC) mode page [0x3] not found

    mode sense (10) cdb: 5a 00 04 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Rigid disk (SBC) mode page [0x4] not found

    mode sense (10) cdb: 5a 00 07 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Verify error recovery (SBC) mode page [0x7] not found

    mode sense (10) cdb: 5a 00 08 00 00 00 00 00 08 00

    mode sense (10) cdb: 5a 00 08 00 00 00 00 00 24 00

    mode sense (10) cdb: 5a 00 48 00 00 00 00 00 24 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

    mode sense (10) cdb: 5a 00 88 00 00 00 00 00 24 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

    mode sense (10) cdb: 5a 00 c8 00 00 00 00 00 24 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Saving parameters not supported

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 39 00 00 00

        00 00

Caching (SBC) [0x8] mode page [PS=0]:

  IC          0

  ABPF        0

  CAP         0

  DISC        0

  SIZE        0

  WCE         1

  MF          0

  RCD         0

  DRRP        0

  WRP         0

  DPTL        0

  MIPF        0

  MAPF        0

  MAPFC       0

  FSW         0

  LBCSS       0

  DRA         0

  NV_DIS      0

  NCS         0

  CSS         0

    mode sense (10) cdb: 5a 00 0a 00 00 00 00 00 08 00

    mode sense (10) cdb: 5a 00 0a 00 00 00 00 00 1c 00

    mode sense (10) cdb: 5a 00 4a 00 00 00 00 00 1c 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

    mode sense (10) cdb: 5a 00 8a 00 00 00 00 00 1c 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

    mode sense (10) cdb: 5a 00 ca 00 00 00 00 00 1c 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Saving parameters not supported

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 39 00 00 00

        00 00

Control [0xa] mode page [PS=0]:

  TST         0

  TMF_ONLY    0

  D_SENSE     0

  GLTSD       1

  RLEC        0

  QAM         0

  QERR        0

  RAC         0

  UA_INTLCK   0

  SWP         0

  ATO         0

  TAS         0

  AUTOLOAD    0

  BTP        -1

  ESTCT      30

    mode sense (10) cdb: 5a 00 0a 01 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Control extension mode subpage [0xa,0x1] not found

    mode sense (10) cdb: 5a 00 0a f1 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> SAT pATA control mode subpage [0xa,0xf1] not found

    mode sense (10) cdb: 5a 00 0d 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Power condition - old version mode page [0xd] not found

    mode sense (10) cdb: 5a 00 10 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> XOR control (SBC) mode page [0x10] not found

    mode sense (10) cdb: 5a 00 18 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Protocol specific logical unit mode page [0x18] not found

    mode sense (10) cdb: 5a 00 19 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Protocol specific port mode page [0x19] not found

    mode sense (10) cdb: 5a 00 1a 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Power condition mode page [0x1a] not found

    mode sense (10) cdb: 5a 00 1c 00 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Informational exceptions control mode page [0x1c] not found

    mode sense (10) cdb: 5a 00 1c 01 00 00 00 00 08 00

mode sense (10):  Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0a  00 00 00 00 24 00 00 00

        00 00

>> Background control (SBC) mode subpage [0x1c,0x1] not found
```

```
# tail /var/log/messages
```

```
Nov  8 06:13:54  kernel: ata7.00: TEST_UNIT_READY failed (err_mask=0x4)

Nov  8 17:12:00  kernel: ata2.00: failed to set xfermode (err_mask=0x100)

EXT3-fs error (device sdb1): ext3_free_blocks: Freeing blocks not in datazone -                                                                                                                                  $

ata2.00: irq_stat 0x08000000, interface fatal error

         res 40/00:04:3f:00:00/00:00:00:00:00/40 Emask 0x10 (ATA bus error)

end_request: I/O error, dev sdb, sector 488191567

EXT3-fs (sdb1): error in ext3_orphan_add: Journal has aborted

EXT3-fs (sdb1): error in ext3_reserve_inode_write: Journal has aborted

ata7.00: failed to set xfermode (err_mask=0x4)

ata7.00: failed to IDENTIFY (I/O error, err_mask=0x4)

Nov 19 20:42:31  kernel: EXT3-fs: barriers not enabled

Nov 19 20:42:32  kernel: ata2.00: exception Emask 0x10 SAct 0x1f SErr 0x800000 action 0x6 frozen

Nov 19 20:42:32  kernel: ata2.00: irq_stat 0x08000000, interface fatal error

Nov 19 20:42:32  kernel: ata2.00: cmd 60/08:00:27:94:1a/00:00:1d:00:00/40 tag 0 ncq 4096 in

Nov 19 20:42:32  kernel: ata2: hard resetting link

Nov 19 20:42:32  kernel: ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310)

Nov 19 20:42:32  kernel: ata2.00: configured for UDMA/33

Nov 19 20:42:32  kernel: ata2: EH complete

Nov 19 20:42:33  kernel: ata2.00: exception Emask 0x10 SAct 0xffff SErr 0xc00001 action 0x6 frozen

Nov 19 20:42:33  kernel: ata2.00: irq_stat 0x08000008, interface fatal error

Nov 19 20:42:39  kernel: sd 1:0:0:0: [sdb]  Result: hostbyte=0x00 driverbyte=0x08

Nov 19 20:42:39  kernel: sd 1:0:0:0: [sdb]  Sense Key : 0xb [current] [descriptor]

Nov 19 20:42:39  kernel: Descriptor sense data with sense descriptors (in hex):

Nov 19 20:42:39  kernel: 72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00

Nov 19 20:42:39  kernel: 08 60 07 27

Nov 19 20:42:39  kernel: sd 1:0:0:0: [sdb]  ASC=0x0 ASCQ=0x0

Nov 19 20:42:39  kernel: sd 1:0:0:0: [sdb] CDB: cdb[0]=0x2a: 2a 00 08 60 0d cf 00 00 20 00

Nov 19 20:42:39  kernel: end_request: I/O error, dev sdb, sector 140512719

Nov 19 20:42:39  kernel: quiet_error: 485 callbacks suppressed

Nov 19 20:42:39  kernel: Buffer I/O error on device sdb1, logical block 17564082

Nov 19 20:42:39  kernel: lost page write due to I/O error on sdb1

Nov 19 20:43:58  kernel: end_request: I/O error, dev sdb, sector 516689943

Nov 19 20:43:58  kernel: ata2: EH complete

Nov 19 20:43:58  kernel: JBD: recovery failed

Nov 19 20:43:58  kernel: EXT3-fs (sdb1): error loading journal
```

... and so on....

making filesystem: 

```
# mkfs.ext4 /dev/sdb1

mke2fs 1.41.14 (22-Dec-2010)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

30531584 inodes, 122096638 blocks

6104831 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

3727 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

        102400000

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.
```

```
# dmesg | grep ata2

ata2: SATA max UDMA/133 abar m2048@0xf9ffe800 port 0xf9ffe980 irq 19

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

ata2.00: ATA-7: WDC WD5000AAKS-00TMA0, 12.01C01, max UDMA/133

ata2.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA

ata2.00: configured for UDMA/133
```

```
# fsck.ext4 /dev/sdb1

e2fsck 1.41.14 (22-Dec-2010)

/dev/sdb1: clean, 11/30531584 files, 1966902/122096638 blocks
```

```
# fsck.ext4 -f /dev/sdb1

e2fsck 1.41.14 (22-Dec-2010)

Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure

Pass 3: Checking directory connectivity

Pass 4: Checking reference counts

Pass 5: Checking group summary information

/dev/sdb1: 11/30531584 files (0.0% non-contiguous), 1966902/122096638 blocks
```

# mount /dev/sdb1 /mnt/hd0

```

dmesg: 

sdb: sdb1

EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
```

After all this i still have doubts what kind of problem was/is. What is your input ?

----------

## energyman76b

get a new harddrive

----------

## ashtophet

I would try getting new SATA cables.

OTH, smartctl could give you some additional hints.

Anyway, be prepared for the worst.

----------

## cach0rr0

once you see things like this:

```

Nov 19 20:42:39  kernel: end_request: I/O error, dev sdb, sector 140512719 

```

time to assume a hardware fault. 

As energyman suggested, it could be a failing disk. 

as ashtophet said, you could also try the optimistic route, and try swapping out SATA cables. 

....but yeah, indeed be prepared for the worst, when I've had disks gradually die, that's normally the first errors I see.

----------

## HeXiLeD

After removing it and replacing it, everything went back to normal. All tests i id on the drive do not show errors. This seems to have been caused by the cable.

However my 400GB HD  from the same box curiously died with similar errors.

This problem is SOLVED

----------

