# ext4 (with discard, TRIM) on a SSD : multiple device errors

## dermund

Hi all,

I followed guides to tune my ssd. After aligning stuff I created a fresh ext4 filesystem on my ssd and copied my system there.

However, when I add 'discard' to the options in the '/etc/fstab' for this filesystem (root filesystem) I get errors like those showed in the listing below. Also, every time I remove files I get a few lines of error code on the console (and in the kern.log).

If I leave out the 'discard' option I do not get those errors!

```

Mar 11 15:36:17 jugger kernel: [    1.850280] ata2.00: ATA-7: Corsair CMFSSD-64D1, 1.0, max UDMA/133

Mar 11 15:36:17 jugger kernel: [    1.850285] ata2.00: 125045424 sectors, multi 1: LBA48 NCQ (depth 31/32), AA

Mar 11 15:36:17 jugger kernel: [    1.850541] ata2.00: configured for UDMA/133

... (later on)

Mar 11 15:36:18 jugger kernel: [    7.246886] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

Mar 11 15:36:18 jugger kernel: [    7.246928] ata2.00: irq_stat 0x40000001

Mar 11 15:36:18 jugger kernel: [    7.246971] ata2.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 20480 out

Mar 11 15:36:18 jugger kernel: [    7.246973]          res 51/04:01:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)

Mar 11 15:36:18 jugger kernel: [    7.247053] ata2.00: status: { DRDY ERR }

Mar 11 15:36:18 jugger kernel: [    7.247086] ata2.00: error: { ABRT }

Mar 11 15:36:18 jugger kernel: [    7.247122] ata2.00: device reported invalid CHS sector 0

Mar 11 15:36:18 jugger kernel: [    7.247159] end_request: I/O error, dev sda, sector 76683264

Mar 11 15:36:18 jugger kernel: [    7.247288] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

Mar 11 15:36:18 jugger kernel: [    7.247332] ata2.00: irq_stat 0x40000001

Mar 11 15:36:18 jugger kernel: [    7.247368] ata2.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 32768 out

Mar 11 15:36:18 jugger kernel: [    7.247369]          res 51/04:01:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)

Mar 11 15:36:18 jugger kernel: [    7.247440] ata2.00: status: { DRDY ERR }

Mar 11 15:36:18 jugger kernel: [    7.247473] ata2.00: error: { ABRT }

Mar 11 15:36:18 jugger kernel: [    7.247507] ata2.00: device reported invalid CHS sector 0

Mar 11 15:36:18 jugger kernel: [    7.247543] end_request: I/O error, dev sda, sector 76924944

Mar 11 15:36:18 jugger kernel: [    7.247673] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

Mar 11 15:36:18 jugger kernel: [    7.247716] ata2.00: irq_stat 0x40000001

Mar 11 15:36:18 jugger kernel: [    7.247751] ata2.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 53248 out

Mar 11 15:36:18 jugger kernel: [    7.247752]          res 51/04:01:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)

... (later on, when a file gets deleted by hand)

Mar 11 15:38:20 jugger kernel: [  129.029166] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

Mar 11 15:38:20 jugger kernel: [  129.029212] ata2.00: irq_stat 0x40000001

Mar 11 15:38:20 jugger kernel: [  129.029261] ata2.00: cmd 06/01:01:00:00:00/00:00:00:00:00/a0 tag 0 dma 4096 out

Mar 11 15:38:20 jugger kernel: [  129.029263]          res 51/04:01:00:00:00/00:00:00:00:00/a0 Emask 0x1 (device error)

Mar 11 15:38:20 jugger kernel: [  129.029372] ata2.00: status: { DRDY ERR }

Mar 11 15:38:20 jugger kernel: [  129.029416] ata2.00: error: { ABRT }

Mar 11 15:38:20 jugger kernel: [  129.029461] ata2.00: device reported invalid CHS sector 0

Mar 11 15:38:20 jugger kernel: [  129.029500] end_request: I/O error, dev sda, sector 76753776

```

Related info:

```

UUID=e014955c-236b-4294-90a9-61e7331338f0       /               ext4    noatime,errors=remount-ro       0 1

```

```

/dev/sda:

ATA device, with non-removable media

   Model Number:       Corsair CMFSSD-64D1                     

   Serial Number:      WBTSV65VW432Y12677EL

   Firmware Revision:  1.0     

Standards:

   Supported: 7 6 5 

   Likely used: 7

Configuration:

   Logical      max   current

   cylinders   16383   16383

   heads      16   16

   sectors/track   63   63

   --

   CHS current addressable sectors:   16514064

   LBA    user addressable sectors:  125045424

   LBA48  user addressable sectors:  125045424

   Logical  Sector size:                   512 bytes

   Physical Sector size:                   512 bytes

   device size with M = 1024*1024:       61057 MBytes

   device size with M = 1000*1000:       64023 MBytes (64 GB)

   cache/buffer size  = unknown

   Nominal Media Rotation Rate: Solid State Device

Capabilities:

   LBA, IORDY(can be disabled)

   Queue depth: 32

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

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

   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

      *   DOWNLOAD_MICROCODE

          SET_MAX security extension

      *   48-bit Address feature set

      *   Device Configuration Overlay feature set

      *   Mandatory FLUSH_CACHE

      *   FLUSH_CACHE_EXT

      *   SMART self-test

      *   General Purpose Logging feature set

      *   Gen1 signaling speed (1.5Gb/s)

      *   Gen2 signaling speed (3.0Gb/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

      *   Data Set Management TRIM supported

      *   Deterministic read data after TRIM

Security: 

      supported

   not   enabled

   not   locked

   not   frozen

   not   expired: security count

   not   supported: enhanced erase

Checksum: correct

```

```

2.6.35-27-generic

```

What does those errors mean? Why are they there? How can I avoid them, while still having the autotrimming feature from ext4?

Kind regards

----------

## frostschutz

I think you need a newer firmware for trim on this device, but I might be wrong

----------

## dermund

Hallo frostschutz,

 *frostschutz wrote:*   

> I think you need a newer firmware for trim on this device, but I might be wrong

 

I think you're right. After reading posts in the corsair forums and in the sticky, quoted below, I think this gets much clearer :

 *http://forum.corsair.com/forums/showthread.php?t=81189 wrote:*   

> 
> 
> Q: Does my X-Series SSD support the TRIM function in Windows 7?
> 
> X-Series SSDs with firmware v1.0 do not support the TRIM function. Upgraded firmware revisions, including revisions with TRIM support, and updating utilities will be made available from the SSD Download Archive on the Corsair forum.
> ...

 

Altough he talks about win7, I doubt that this means that firmware v1.0 can magically do the trick on linux.

I try to flash the current firmware and will report back.

Maybe all the guides are wrong when they say, if the following, from hdparm, is true, then TRIM will work:

      *   Data Set Management TRIM supported

      *   Deterministic read data after TRIM 

Whatever, no guide is perfect...

----------

## dermund

After trying a few times according to this:

http://forum.corsair.com/forums/showthread.php?t=84600

and this:

http://forum.corsair.com/v3/showthread.php?t=85359

...my drive is now rendered unusable and I am now waiting for a rma to return it back to corsair.

I tried the flash procedure on three different computers, with different results, no success, but a drive that is now not being recognized.

Well, at least I made a backup...

----------

