I am facing the following problem: btrfs reports write errors for sector 128 on device /dev/sdd
:
sd 6:0:0:0: [sdd] Invalid command failure
sd 6:0:0:0: [sdd] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 6:0:0:0: [sdd] Sense Key : Illegal Request [current]
sd 6:0:0:0: [sdd] Add. Sense: Invalid field in cdb
sd 6:0:0:0: [sdd] CDB: Write(10): 2a 08 00 00 00 80 00 00 08 00
end_request: critical target error, dev sdd, sector 128
BTRFS: lost page write due to I/O error on /dev/sdd
BTRFS: bdev /dev/sdd errs: wr 913238, rd 1, flush 150, corrupt 0, gen 0
I have run badblocks /dev/sdd
and it returned no badblocks. Anyway, I decided to stay on safe side (in a way), created a partition that starts at sector 2048 (default):
# fdisk -l /dev/sdd
Device Boot Start End Sectors Size Id Type
/dev/sdd1 2048 234441647 234439600 111.8G 83 Linux
and re-added the drive to btrfs volume. Instantly I got the same write error again (note that 2176 = 2048 + 128):
sd 13:0:0:0: [sdd] Invalid command failure
sd 13:0:0:0: [sdd] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 13:0:0:0: [sdd] Sense Key : Illegal Request [current]
sd 13:0:0:0: [sdd] Add. Sense: Invalid field in cdb
sd 13:0:0:0: [sdd] CDB: Write(10): 2a 08 00 00 08 80 00 00 08 00
end_request: critical target error, dev sdd, sector 2176
BTRFS: lost page write due to I/O error on /dev/sdd1
BTRFS: bdev /dev/sdd1 errs: wr 12253, rd 0, flush 0, corrupt 0, gen 0
Could it be that both sectors 128 and 2176 are bad? Well, I have re-run badblocks /dev/sdd
(again, it has reported no bad blocks), and pushed the partition further away:
# fdisk -l /dev/sdd
Device Boot Start End Sectors Size Id Type
/dev/sdd1 4096 234441647 234437552 111.8G 83 Linux
and re-created btrfs volume. Again "bad block" at the same magic place (4224 = 4096 + 128):
sd 6:0:0:0: [sdd] Invalid command failure
sd 6:0:0:0: [sdd] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 6:0:0:0: [sdd] Sense Key : Illegal Request [current]
sd 6:0:0:0: [sdd] Add. Sense: Invalid field in cdb
sd 6:0:0:0: [sdd] CDB: Write(10): 2a 08 00 00 10 80 00 00 08 00
end_request: critical target error, dev sdd, sector 4224
BTRFS: lost page write due to I/O error on /dev/sdd1
BTRFS: bdev /dev/sdd1 errs: wr 124433, rd 0, flush 0, corrupt 0, gen 0
I don't believe in co-incidences, namely, that no other sector before magic 128 and after 128 are failing, but that specific one is problematic.
What is can be? For me sounds like a bug in kernel.
Additional info:
- Linux kernel v3.16.0
/dev/sdd
is connected via SATA-to-USB adapter JMicron (ID 152d:0567, see how it looks like):
dmesg:
sd 4:0:0:0: [sdb] Attached SCSI disk
scsi 6:0:0:0: Direct-Access JMicron Generic 0116 PQ: 0 ANSI: 6
sd 6:0:0:0: Attached scsi generic sg5 type 0
sd 6:0:0:0: [sdd] 234441648 512-byte logical blocks: (120 GB/111 GiB)
sd 6:0:0:0: [sdd] Write Protect is off
sd 6:0:0:0: [sdd] Mode Sense: 47 00 10 08
sd 6:0:0:0: [sdd] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 6:0:0:0: [sdd] Attached SCSI disk