baruch / diskscan

Scan disk for bad or near failure sectors, performs disk diagnostics
GNU General Public License v3.0
108 stars 29 forks source link

Old SCSI device fails at inquiry stage #54

Closed stygge-ulv closed 8 years ago

stygge-ulv commented 8 years ago

Hi, as the subject line indicates diskscan does not recognize my SCSI disk which have a valid partion table and is mountable.

I get the following output : ./diskscan -v /dev/sdb diskscan version 0.19

V: Verbosity set I: Validating path /dev/sdb E: Can't identify disk for path /dev/sdb, errno=0: Success I: Closed disk

and dmesg says:

[88460.672403] sdb: sdb1

output from lscpi is the following:

root@krypton:/home/jan# lspci 00:00.0 Host bridge: Intel Corporation 82850 850 (Tehama) Chipset Host Bridge (MCH) (rev 04) 00:01.0 PCI bridge: Intel Corporation 82850 850 (Tehama) Chipset AGP Bridge (rev 04) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 04) 00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 04) 00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 Controller (rev 04) 00:1f.2 USB controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 04) 00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus Controller (rev 04) 00:1f.4 USB controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 04) 00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio Controller (rev 04) 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] R420 [Radeon X800 AGP Series] 01:00.1 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] R420 Radeon X800 XT AGP 02:08.0 Ethernet controller: Intel Corporation 82801BA/BAM/CA/CAM Ethernet Controller (rev 03) 02:0a.0 SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U 02:0d.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)

and output from fdisk is :

Disk /dev/sdb: 68.4 GiB, 73407488000 bytes, 143374000 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 Disklabel type: gpt Disk identifier: 5CF4108D-DA5E-4691-8AA0-CAEEC16BBA2C

Device Start End Sectors Size Type /dev/sdb1 2048 143373966 143371919 68.4G Linux filesystem

I have downloaded the latest release and compiled it, since the version that comes with Debian 8.2 also fails

V: Verbosity set I: Validating path /dev/sdb E: IO failed with no sense: status=2 mask=1 driver=8 msg=0 host=0 E: Can't identify disk for path /dev/sdb: Success I: Closed disk

Any ideas ?

best regards

baruch commented 8 years ago

Can you show the output with triple verbose?

Baruch

On Sat, Jan 16, 2016, 16:13 stygge-ulv notifications@github.com wrote:

Hi, as the subject line indicates diskscan does not recognize my SCSI disk which have a valid partion table and is mountable

I get the following output : /diskscan -v /dev/sdb diskscan version 019

V: Verbosity set I: Validating path /dev/sdb E: Can't identify disk for path /dev/sdb, errno=0: Success I: Closed disk

and dmesg says:

[88460672403] sdb: sdb1

output from lscpi is the following:

root@krypton:/home/jan# lspci 00:000 Host bridge: Intel Corporation 82850 850 (Tehama) Chipset Host Bridge (MCH) (rev 04) 00:010 PCI bridge: Intel Corporation 82850 850 (Tehama) Chipset AGP Bridge (rev 04) 00:1e0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 04) 00:1f0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 04) 00:1f1 IDE interface: Intel Corporation 82801BA IDE U100 Controller (rev 04) 00:1f2 USB controller: Intel Corporation 82801BA/BAM USB Controller #1 https://github.com/baruch/diskscan/issues/1 (rev 04) 00:1f3 SMBus: Intel Corporation 82801BA/BAM SMBus Controller (rev 04) 00:1f4 USB controller: Intel Corporation 82801BA/BAM USB Controller #1 https://github.com/baruch/diskscan/issues/1 (rev 04) 00:1f5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio Controller (rev 04) 01:000 VGA compatible controller: Advanced Micro Devices, Inc [AMD/ATI] R420 [Radeon X800 AGP Series] 01:001 Display controller: Advanced Micro Devices, Inc [AMD/ATI] R420 Radeon X800 XT AGP http://Secondary 02:080 Ethernet controller: Intel Corporation 82801BA/BAM/CA/CAM Ethernet Controller (rev 03) 02:0a0 SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U 02:0d0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)

and output from fdisk is :

Disk /dev/sdb: 684 GiB, 73407488000 bytes, 143374000 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 Disklabel type: gpt Disk identifier: 5CF4108D-DA5E-4691-8AA0-CAEEC16BBA2C

Device Start End Sectors Size Type /dev/sdb1 2048 143373966 143371919 684G Linux filesystem

I have downloaded the latest release and compiled it, since the version that comes with Debian 82 also fails

V: Verbosity set I: Validating path /dev/sdb E: IO failed with no sense: status=2 mask=1 driver=8 msg=0 host=0 E: Can't identify disk for path /dev/sdb: Success I: Closed disk

Any ideas ?

best regards

— Reply to this email directly or view it on GitHub https://github.com/baruch/diskscan/issues/54.

stygge-ulv commented 8 years ago

I assume it means -vvv option? If yes, here is the output. But not much more info. I was looking for a way to compile it with a higher debug level, but have not yet found any info on that.

root@krypton:/home/jan/Downloads/diskscan-master# ./diskscan -vvv /dev/sdbdiskscan version 0.19

V: Verbosity set V: High verbosity set V: Very high verbosity set I: Validating path /dev/sdb E: Can't identify disk for path /dev/sdb, errno=0: Success I: Closed disk

baruch commented 8 years ago

Strange, can you see if there are messages in dmesg about sense errors from the disk?

On Sat, Jan 16, 2016, 17:05 stygge-ulv notifications@github.com wrote:

I assume it means -vvv option? If yes, here is the output. But not much more info. I was looking for a way to compile it with a higher debug level, but have not yet found any info on that.

root@krypton:/home/jan/Downloads/diskscan-master# ./diskscan -vvv /dev/sdbdiskscan version 0.19

V: Verbosity set V: High verbosity set V: Very high verbosity set

I: Validating path /dev/sdb E: Can't identify disk for path /dev/sdb, errno=0: Success I: Closed disk

Reply to this email directly or view it on GitHub https://github.com/baruch/diskscan/issues/54#issuecomment-172214600.

stygge-ulv commented 8 years ago

dmesg does not make much of an effor to help. The last few entries from multiple attempts

[88460.672403] sdb: sdb1 [89869.814142] sdb: sdb1 [89881.850758] sdb: sdb1 [89898.961480] sdb: sdb1 [92312.411514] sdb: sdb1 [92708.925141] sdb: sdb1 [93066.670551] sdb: sdb1 [93289.521490] sdb: sdb1

baruch commented 8 years ago

I'll try to look at this later on. Can't do much just now.

Baruch

On Sat, Jan 16, 2016, 17:10 stygge-ulv notifications@github.com wrote:

dmesg does not make much of an effor to help. The last few entries from multiple attempts

[88460.672403] sdb: sdb1 [89869.814142] sdb: sdb1 [89881.850758] sdb: sdb1 [89898.961480] sdb: sdb1 [92312.411514] sdb: sdb1 [92708.925141] sdb: sdb1 [93066.670551] sdb: sdb1 [93289.521490] sdb: sdb1

— Reply to this email directly or view it on GitHub https://github.com/baruch/diskscan/issues/54#issuecomment-172214810.

stygge-ulv commented 8 years ago

ok.

I just downloaded lsscsi and got the following output. Have no idea if it is any help.

root@krypton:/home/jan# lsscsi -l -vvv sysfsroot: /sys [0:0:0:0] cd/dvd PLEXTOR DVDR PX-708A 1.12 /dev/sr0 state=running queue_depth=1 scsi_level=6 type=5 device_blocked=0 timeout=30 dir: /sys/bus/scsi/devices/0:0:0:0 [/sys/devices/pci0000:00/0000:00:1f.1/ata1/host0/target0:0:0/0:0:0:0] [2:0:0:0] disk IBM-ESXS MAP3735NP FN B109 /dev/sda state=running queue_depth=8 scsi_level=4 type=0 device_blocked=0 timeout=30 dir: /sys/bus/scsi/devices/2:0:0:0 [/sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.0/host2/target2:0:0/2:0:0:0] [2:0:1:0] disk IBM-ESXS ST373405LW !# B243 /dev/sdb state=running queue_depth=8 scsi_level=4 type=0 device_blocked=0 timeout=30 dir: /sys/bus/scsi/devices/2:0:1:0 [/sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.0/host2/target2:0:1/2:0:1:0] [2:0:2:0] disk IBM-ESXS ST3146807LW FN B258 /dev/sdc state=running queue_depth=8 scsi_level=4 type=0 device_blocked=0 timeout=30 dir: /sys/bus/scsi/devices/2:0:2:0 [/sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.0/host2/target2:0:2/2:0:2:0] [4:0:0:0] cd/dvd TSSTcorp CDDVDW SE-208AB TS00 /dev/sr1 state=running queue_depth=1 scsi_level=0 type=5 device_blocked=0 timeout=30 dir: /sys/bus/scsi/devices/4:0:0:0 [/sys/devices/pci0000:00/0000:00:1f.4/usb2/2-1/2-1.1/2-1.1:1.0/host4/target4:0:0/4:0:0:0]

stygge-ulv commented 8 years ago

and some more detail from lsscsi

[2:0:1:0] disk IBM-ESXS ST373405LW !# B243 /dev/sdb device_blocked=0 iocounterbits=32 iodone_cnt=0x89a7dd ioerr_cnt=0x32 iorequest_cnt=0x89a7dd queue_depth=8 queue_type=ordered scsi_level=4 state=running timeout=30 type=0 dir: /sys/bus/scsi/devices/2:0:1:0 [/sys/devices/pci0000:00/0000:00:1e.0/0000:02:0a.0/host2/target2:0:1/2:0:1:0]

baruch commented 8 years ago

I pushed some code to add a little bit more information to why this fails for you. Can you please try it, use -vvv again too.

It would also help to have a run under strace and send me the system call log, as in:

strace -o /tmp/diskscan.strace.log ./diskscan /dev/sdb

and send the resulting /tmp/diskscan.strace.log file.

baruch commented 8 years ago

It looks to be connected through an Adaptec Parallel SCSI device, I haven't seen one of those in a long time and obviously had no testing through such a device. I suspect the driver doesn't passes through the SCSI commands properly and there may be a need for an alternate ioctl to get through this.

I'd need some more details to try to figure it out:

stygge-ulv commented 8 years ago

Hi Baruch,

I have compiled the code in debug mode and ran it through with gdb and traced the problem to a function call parse_inquiry() which parse the result of a call to cdb_inquiry() where an ioctl() call apparently returns zero bytes so disk identity data such as vendor id etc. is missing. The ioctl call returns with a zero code so it apparently succeed, just without any data. Another earler ioctl call to determin block size and max LBA address succeed and so does the parsing of the result with correct values cheked by fdisk.

I will look into the recommendations you made and come back when I got the information you need.

stygge-ulv

stygge-ulv commented 8 years ago

I have tried downloading the code again, and also the debian branch and recompiled. There is no more output with -vvv verbose than in the earlier version. Am I doint something wrong (Newbie here)

baruch commented 8 years ago

The master branch is what you need. If there is no additional data than there is no new information to use. The dates indeed confess in empty, there is an error indication but no sense which is strange. I'll try to set what can be done.

Baruch

On Sat, Jan 16, 2016, 22:43 stygge-ulv notifications@github.com wrote:

I have tried downloading the code again, and also the debian branch and recompiled. There is no more output with -vvv verbose than in the earlier version. Am I doint something wrong (Newbie here)

— Reply to this email directly or view it on GitHub https://github.com/baruch/diskscan/issues/54#issuecomment-172256734.

stygge-ulv commented 8 years ago

I have created the strace log, but how do i send it ? (Newbie - sorry)

System is a Debian 8.2.0 i386

uname -a Linux krypton 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02) i686 GNU/Linux

lspci -vvv

00:00.0 Host bridge: Intel Corporation 82850 850 (Tehama) Chipset Host Bridge (MCH) (rev 04) Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx- Latency: 0 Region 0: Memory at f0000000 (32-bit, prefetchable) [size=128M] Capabilities: [a0] AGP version 2.0 Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3- Rate=x1,x2,x4 Command: RQ=1 ArqSz=0 Cal=0 SBA+ AGP+ GART64- 64bit- FW- Rate=x4 Kernel driver in use: agpgart-intel

00:01.0 PCI bridge: Intel Corporation 82850 850 (Tehama) Chipset AGP Bridge (rev 04) (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 32 Bus: primary=00, secondary=01, subordinate=01, sec-latency=32 I/O behind bridge: 0000c000-0000cfff Memory behind bridge: ff800000-ff8fffff Prefetchable memory behind bridge: ce900000-ee9fffff Secondary status: 66MHz+ FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ <SERR- <PERR- BridgeCtl: Parity- SERR+ NoISA- VGA+ MAbort- >Reset- FastB2B- PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 04) (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 0 Bus: primary=00, secondary=02, subordinate=02, sec-latency=32 I/O behind bridge: 0000d000-0000dfff Memory behind bridge: ff900000-ff9fffff Prefetchable memory behind bridge: eea00000-eeafffff Secondary status: 66MHz- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ <SERR- <PERR- BridgeCtl: Parity- SERR+ NoISA+ VGA- MAbort- >Reset- FastB2B- PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-

00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 04) Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 0 Kernel driver in use: lpc_ich

00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 Controller (rev 04) (prog-if 80 [Master]) Subsystem: Intel Corporation Device 6d76 Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 0 Region 0: [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [size=8] Region 1: [virtual] Memory at 000003f0 (type 3, non-prefetchable) Region 2: [virtual] Memory at 00000170 (32-bit, non-prefetchable) [size=8] Region 3: [virtual] Memory at 00000370 (type 3, non-prefetchable) Region 4: I/O ports at ffa0 [size=16] Kernel driver in use: ata_piix

00:1f.2 USB controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 04) (prog-if 00 [UHCI]) Subsystem: Intel Corporation Device 6d76 Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 0 Interrupt: pin D routed to IRQ 19 Region 4: I/O ports at ef40 [size=32] Kernel driver in use: uhci_hcd

00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus Controller (rev 04) Subsystem: Intel Corporation Device 6d76 Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Interrupt: pin B routed to IRQ 17 Region 4: I/O ports at efa0 [size=16] Kernel driver in use: i801_smbus

00:1f.4 USB controller: Intel Corporation 82801BA/BAM USB Controller #1 (rev 04) (prog-if 00 [UHCI]) Subsystem: Intel Corporation Device 6d76 Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 0 Interrupt: pin C routed to IRQ 23 Region 4: I/O ports at ef80 [size=32] Kernel driver in use: uhci_hcd

00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio Controller (rev 04) Subsystem: Intel Corporation Device 6d76 Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 0 Interrupt: pin B routed to IRQ 17 Region 0: I/O ports at e800 [size=256] Region 1: I/O ports at ef00 [size=64] Kernel driver in use: snd_intel8x0

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] R420 [Radeon X800 AGP Series](prog-if 00 [VGA controller]) Subsystem: PC Partner Limited / Sapphire Technology Device 13d0 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 32 (2000ns min), Cache Line Size: 32 bytes Interrupt: pin A routed to IRQ 16 Region 0: Memory at e0000000 (32-bit, prefetchable) [size=128M] Region 1: I/O ports at c800 [size=256] Region 2: Memory at ff8f0000 (32-bit, non-prefetchable) [size=64K] Expansion ROM at ff8c0000 [disabled] [size=128K] Capabilities: [58] AGP version 2.0 Status: RQ=80 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3- Rate=x1,x2,x4 Command: RQ=32 ArqSz=0 Cal=0 SBA+ AGP+ GART64- 64bit- FW- Rate=x4 Capabilities: [50] Power Management version 2 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Kernel driver in use: radeon

01:00.1 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] R420 Radeon X800 XT AGP Subsystem: PC Partner Limited / Sapphire Technology Device 13d1 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 32 (2000ns min), Cache Line Size: 32 bytes Region 0: Memory at d8000000 (32-bit, prefetchable) [size=128M] Region 1: Memory at ff8e0000 (32-bit, non-prefetchable) [size=64K] Capabilities: [50] Power Management version 2 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

02:08.0 Ethernet controller: Intel Corporation 82801BA/BAM/CA/CAM Ethernet Controller (rev 03) Subsystem: Intel Corporation EtherExpress PRO/100 VM Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 32 (2000ns min, 14000ns max), Cache Line Size: 32 bytes Interrupt: pin A routed to IRQ 20 Region 0: Memory at ff9fe000 (32-bit, non-prefetchable) [size=4K] Region 1: I/O ports at df00 [size=64] Capabilities: [dc] Power Management version 2 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=2 PME- Kernel driver in use: e100

02:0a.0 SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 32 (2000ns min, 2000ns max), Cache Line Size: 32 bytes Interrupt: pin A routed to IRQ 22 Region 0: I/O ports at d800 [disabled] [size=256] Region 1: Memory at ff9ff000 (32-bit, non-prefetchable) [size=4K] Expansion ROM at ff9e0000 [disabled] [size=64K] Kernel driver in use: aic7xxx

02:0d.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) Subsystem: Intel Corporation PRO/1000 MT Server Adapter Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 32 (63750ns min), Cache Line Size: 32 bytes Interrupt: pin A routed to IRQ 21 Region 0: Memory at ff9a0000 (64-bit, non-prefetchable) [size=128K] Region 4: I/O ports at de80 [size=64] Capabilities: [dc] Power Management version 2 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Capabilities: [e4] PCI-X non-bridge device Command: DPERE- ERO+ RBC=512 OST=1 Status: Dev=00:00.0 64bit+ 133MHz+ SCD- USC- DC=simple DMMRBC=2048 DMOST=1 DMCRS=16 RSCEM- 266MHz- 533MHz- Capabilities: [f0] MSI: Enable- Count=1/1 Maskable- 64bit+ Address: 0000000000000000 Data: 0000 Kernel driver in use: e1000

stygge-ulv commented 8 years ago

I have made the strace file but sad to say, I don't know hot to send it to you :-) Please explain.

stygge-ulv commented 8 years ago

I made it work brute-force by putting a return 0 statment in arch-linux.c after line 460, in function disk_dev_identify() function, skipping the check for parsing of the inquiry. Ugly, but works. I don't know if there would be any ill effects. But it confirms the debug I made that it is the sg_ioctl() that get nothing back but with a return code 0.

baruch commented 8 years ago

I suspect it is an old SCSI device that wont accept a large buffer for inquiry data, I modified the code to only ask for what's needed. Can you please try the latest master now?

baruch commented 8 years ago

You can send the strace by email to me at baruch@ev-en.org

stygge-ulv commented 8 years ago

Hi Baruch,

that did the trick. I works fine now. Do you still want the strace file ?

And thanks a lot for you help. Great experience for a first encounter on a new site.

best

baruch commented 8 years ago

No need for the strace anymore.

I would appreciate getting an email from you and maybe trying a few things outside of this bug since I have no way to test behavior of such disks otherwise and it would be nice to get some data out of them. Shoot me an email if you are open to that.

baruch commented 8 years ago

The fix was to only request 32 bytes to avoid an issue with the old SCSI standard implementation. 32 bytes is too small to cover all data though, need to check if 64 bytes works too.

stygge-ulv commented 8 years ago

Hi Baruch

Just let me know how i can assist you with the troubleshooting of the old disks.

Jan On 17 Jan 2016 06:27, "Baruch Even" notifications@github.com wrote:

No need for the strace anymore.

I would appreciate getting an email from you and maybe trying a few things outside of this bug since I have no way to test behavior of such disks otherwise and it would be nice to get some data out of them. Shoot me an email if you are open to that.

— Reply to this email directly or view it on GitHub https://github.com/baruch/diskscan/issues/54#issuecomment-172293284.

baruch commented 8 years ago

If you can go into the code and change the 32 to 64 or even 128 and see if they work for you that would be nice.

Another thing I'd be happy to get is if you can check out libscsicmd latest master, compile it and run the test/collect_raw_data script and send me the output, it will collect all possible outputs on all diagnostics commands and enable me to improve parsing of various scsi devices.

stygge-ulv commented 8 years ago

Hi Baruch, I assume it is the value of the second call argument of function call cdb_inquiry_simple() in function disk_dev_identify() that you want me to change from 32 to 64 and 128 ? In the last master it was already changed from yesterdays value of 32 to 64. I have checked both 64 and 128 and they both worked. However I noticed that the declaration of the cdb fuffer is cdb[32]. I would have expected it to be the same size as the lengh - i.e. 32, 64 or 128. It seems there could be a chance of going beyond the end of the buffer if not equal. I also checked 256 but that failed.

I will look into the other issue requested. Stay tuned.

stygge-ulv commented 8 years ago

I downloaded and compiled the libscsiscmd and ran the command collect_raw_data /dev/sdb but I get an error message saying Usage: collect_raw_data disk_device ?

baruch commented 8 years ago

Thanks for the update on the inquiry command, the size is for the buffer to be filled and not the CDB and the buffer is already defined to be 512 bytes so there is plenty of space in it.

The collect_raw_data script works only with sg devices so you need to look at lsscsi -g and see what is the sg device name for it, most likely /dev/sg1.

stygge-ulv commented 8 years ago

According to the following link, the default inquiry buffer length seems to be 96 characters ?

http://www.tldp.org/HOWTO/archived/SCSI-Programming-HOWTO/SCSI-Programming-HOWTO-9.html

baruch commented 8 years ago

Thanks. I've updated all my related programs to use 96 bytes as the default.