Re: Zip 100 ATAPI not working, "qc timeout" and "failed to clear UNIT ATTENTION"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/02/2025 01:57, Niklas Cassel wrote:
Please try this patch:
https://lore.kernel.org/linux-ide/20250221015422.20687-2-cassel@xxxxxxxxxx/T/#u

and see if it fixes your problem.

Please also make sure to check that you can still write and read back what
you wrote to the device (with the read data matching the written data).

I can confirm the patch works!

I was slightly amused to see this bug appears to be 19 years old: https://github.com/torvalds/linux/blame/master/drivers/ata/libata-eh.c#L1546 It's understandable, in May 2006 the Zip drive was probably still around in places, but quite obsolete. The ATAPI internal versions were uncommon, most would have been external parallel, USB or SCSI.


I'm not sure if the Read Capacity command failing is a problem, it seems to succeed on the second attempt. My guess is the drive can't handle SCSI commands while it's doing a load or eject (probably updating the management data aka z-tracks).

[ 79.936649] sd 3:0:0:0: [sdb] Read Capacity(16) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[   79.936692] sd 3:0:0:0: [sdb] Sense not available.
[  162.381077] sdb: detected capacity change from 196608 to 0
[  164.969080] sd 3:0:0:0: [sdb] Spinning up disk...
[  166.004048] ..ready
[ 167.262210] sd 3:0:0:0: [sdb] Read Capacity(16) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[  167.262244] sd 3:0:0:0: [sdb] Sense not available.
[ 167.305302] sd 3:0:0:0: [sdb] 196608 512-byte logical blocks: (101 MB/96.0 MiB)
[  167.349309] sdb: detected capacity change from 0 to 196608
[  167.480724]  sdb: [mac] sdb1 sdb2 sdb3 sdb4 sdb5
[ 192.527434] systemd-journald[260]: Failed to set ACL on /var/log/journal/44cff3865dce455fac8b3c3db744ba67/user-1000.journal, ignoring: Operation not supported [ 204.709301] sd 3:0:0:0: [sdb] Read Capacity(16) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[  204.709334] sd 3:0:0:0: [sdb] Sense not available.


It seems to be able to read and write correctly -- I can read the contents of the disk, write random data, and read the random data back correctly.

Dump the original contents of the disk:
# ddrescue /dev/sdb zip_orig
GNU ddrescue 1.27
Press Ctrl-C to interrupt
     ipos:  100597 kB, non-trimmed:        0 B,  current rate:    589 kB/s
     opos:  100597 kB, non-scraped:        0 B,  average rate:    792 kB/s
non-tried:        0 B,  bad-sector:        0 B,    error rate:       0 B/s
  rescued:  100663 kB,   bad areas:        0,        run time:      2m  6s
pct rescued:  100.00%, read errors:        0,  remaining time:         n/a
                              time since last successful read:         n/a
Copying non-tried blocks... Pass 1 (forwards)
Finished

Create 100MB of randomness, write it to the disk:
# dd if=/dev/urandom of=ziptest bs=512 count=196608
196608+0 records in
196608+0 records out
100663296 bytes (101 MB, 96 MiB) copied, 2.74086 s, 36.7 MB/s
# dd if=ziptest of=/dev/sdb bs=512
196608+0 records in
196608+0 records out
100663296 bytes (101 MB, 96 MiB) copied, 226.022 s, 445 kB/s

Read it back:
# ddrescue /dev/sdb ziptest_read
GNU ddrescue 1.27
Press Ctrl-C to interrupt
     ipos:  100597 kB, non-trimmed:        0 B,  current rate:    196 kB/s
     opos:  100597 kB, non-scraped:        0 B,  average rate:   1059 kB/s
non-tried:        0 B,  bad-sector:        0 B,    error rate:       0 B/s
  rescued:  100663 kB,   bad areas:        0,        run time:      1m 34s
pct rescued:  100.00%, read errors:        0,  remaining time:         n/a
                              time since last successful read:         n/a
Copying non-tried blocks... Pass 1 (forwards)
Finished

Compare:
# md5sum ziptest*
f132f7ad38beef40d45ce9f96a6e9f92  ziptest
f132f7ad38beef40d45ce9f96a6e9f92  ziptest_read

Thanks.
--
Phil.
philpem@xxxxxxxxxxxxx
https://www.philpem.me.uk/




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux