0-duke / wdpassport-utils

WD Passport Ultra Linux Utilities
GNU General Public License v2.0
228 stars 84 forks source link

Error when hard drive is in power save mode #8

Open www-MKRD-info opened 6 years ago

www-MKRD-info commented 6 years ago

Hello, If the HD is currently in power save mode, the following extensive but non-intuitive error is shown: "Traceback (most recent call last): File "./wdpassport-utils.py", line 428, in main(sys.argv[1:]) File "./wdpassport-utils.py", line 412, in main unlock() File "./wdpassport-utils.py", line 199, in unlock iteration,salt,hint = read_handy_store_block1() File "./wdpassport-utils.py", line 142, in read_handy_store_block1 sector_data = read_handy_store(1) File "./wdpassport-utils.py", line 94, in read_handy_store data = py_sg.read(dev, _scsi_pack_cdb(cdb), BLOCK_SIZE) py_sg.SCSIError: (1, 0, 8, 'p\x00\x02\x00\x00\x00\x00\n\x00\x00\x00\x00\x04\x01\x00\x00\x00\x00') " AFTER the error is shown, the hard drive starts coming out of Power Save mode. Then, the utility has to be re-run with the password again to be able to unlock the HD.

It would be nice if the HD was pinged (or say a random read request was requested) or some other method was used to bring it out of Power Save mode before utility tries to unlock the HD.

www-MKRD-info commented 4 years ago

0-duke, Yeah, minor issue still present in V0.2(2), but I see your won't fix tag. I think it is resolvabe with a ping command or a longer time-out somehow specified by the script. Command literally bombs out only 2-3 seconds before the drive has woken up and is ready.

To others reading this, my "workaround" is as follows.

  1. If I think the drive has been used recently / I can tell it is not sleeping from faint noises or vibration, then I can try entering the unlock command and a password, at minor ""risk"" that I will waste the time entering a long password... If drive is not sleeping, it will unlock. If drive is sleeping, it takes a few seconds longer than the script tolerates, and the script bombs out.
  2. If I KNOW that the drive is sleeping and is locked (has not been used recently), I simply type a short and wrong password to wake the drive up.
  3. The command bombs out.
  4. I immediately up-arrow+Enter to re-enter the command, and by the time I am done typing my real and longer password, the drive is ready to be unlocked, and is unlocked.