ruudkoot

Untitled

Jan 29th, 2012
97
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Unfortunately sg_sat_set_features doesn't work:
  2.  
  3. galahad:~/sg3_utils-1.33/src# ./sg_sat_set_features -vvv --feature=0bh --lba=0 /dev/hdc
  4. open /dev/hdc with flags=0x4002
  5. ATA pass through (16) cdb: 85 06 0c 00 0b 00 00 00 00 00 00 00 00 00 ef 00
  6. ioctl(SG_IO) failed: Invalid argument (errno=22)
  7. duration=0 ms
  8. ATA pass through (16): os error: Invalid argument
  9. ATA pass through (16) failed
  10.  
  11. This is probably a kernel limitation. CONFIG_IDE_TASK_IOCTL isn't supported either:
  12.  
  13. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose --read-sector 0 /dev/hdc
  14.  
  15. /dev/hdc:
  16. reading sector 0: oflags.lob_all=0x3f, flags={ nsect lbal lbam lbah dev command }
  17. oflags.hob_all=0x00, flags={ }
  18. outgoing cdb: 85 08 0e 00 00 00 01 00 00 00 00 00 00 e0 20 00
  19. ioctl(fd,SG_IO): Invalid argument
  20. trying legacy HDIO_DRIVE_TASKFILE
  21. rc=-1, errno=22, returned ATA registers: er=00 st=20
  22. The running kernel lacks CONFIG_IDE_TASK_IOCTL support for this device.
  23. FAILED: Invalid argument
  24.  
  25. Getting and setting AAM works like a charm though:
  26.  
  27. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -M /dev/hdc
  28.  
  29. /dev/hdc:
  30. outgoing cdb: 85 08 0e 00 00 00 01 00 00 00 00 00 00 40 ec 00
  31. ioctl(fd,SG_IO): Invalid argument
  32. Trying legacy HDIO_DRIVE_CMD
  33. acoustic = 254 (128=quiet ... 254=fast)
  34. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -M 128 /dev/hdc
  35.  
  36. /dev/hdc:
  37. setting acoustic management to 128
  38. outgoing cdb: 85 06 20 00 42 00 80 00 00 00 00 00 00 40 ef 00
  39. ioctl(fd,SG_IO): Invalid argument
  40. Trying legacy HDIO_DRIVE_CMD
  41. outgoing cdb: 85 08 0e 00 00 00 01 00 00 00 00 00 00 40 ec 00
  42. ioctl(fd,SG_IO): Invalid argument
  43. Trying legacy HDIO_DRIVE_CMD
  44. acoustic = 128 (128=quiet ... 254=fast)
  45.  
  46. Reading the current WRV value as well:
  47.  
  48. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -R /dev/hdc
  49.  
  50. /dev/hdc:
  51. outgoing cdb: 85 08 0e 00 00 00 01 00 00 00 00 00 00 40 ec 00
  52. ioctl(fd,SG_IO): Invalid argument
  53. Trying legacy HDIO_DRIVE_CMD
  54. write-read-verify = 0
  55.  
  56. Setting it to zero works OK, but doesn't enable WRV:
  57.  
  58. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -I /dev/hdc
  59. ...
  60. * 64-bit World wide name
  61. Write-Read-Verify feature set
  62. * WRITE_UNCORRECTABLE_EXT command
  63. ...
  64. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -R 0 /dev/hdc
  65.  
  66. /dev/hdc:
  67. setting write-read-verify to 0
  68. outgoing cdb: 85 06 20 00 8b 00 00 00 00 00 00 00 00 40 ef 00
  69. ioctl(fd,SG_IO): Invalid argument
  70. Trying legacy HDIO_DRIVE_CMD
  71. outgoing cdb: 85 08 0e 00 00 00 01 00 00 00 00 00 00 40 ec 00
  72. ioctl(fd,SG_IO): Invalid argument
  73. Trying legacy HDIO_DRIVE_CMD
  74. write-read-verify = 0
  75. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -I /dev/hdc
  76. ...
  77. * 64-bit World wide name
  78. Write-Read-Verify feature set
  79. * WRITE_UNCORRECTABLE_EXT command
  80. ...
  81.  
  82. Interestingly enough the CDB here differs from the one sg_sat_set_features tries to issue. Is -R 0 supposted to set Mode 0 (which is what I want) or disable WRV?
  83. Setting WRV to 1, 2 or 3 fails:
  84.  
  85. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -R 1 /dev/hdc
  86.  
  87. /dev/hdc:
  88. setting write-read-verify to 1
  89. outgoing cdb: 85 06 20 00 0b 00 01 00 00 00 00 00 00 40 ef 00
  90. ioctl(fd,SG_IO): Invalid argument
  91. Trying legacy HDIO_DRIVE_CMD
  92. HDIO_DRIVE_CMD:WRV failed: Input/output error
  93. outgoing cdb: 85 08 0e 00 00 00 01 00 00 00 00 00 00 40 ec 00
  94. ioctl(fd,SG_IO): Invalid argument
  95. Trying legacy HDIO_DRIVE_CMD
  96. write-read-verify = 0
  97. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -R 2 /dev/hdc
  98.  
  99. /dev/hdc:
  100. setting write-read-verify to 2
  101. outgoing cdb: 85 06 20 00 0b 00 02 00 00 00 00 00 00 40 ef 00
  102. ioctl(fd,SG_IO): Invalid argument
  103. Trying legacy HDIO_DRIVE_CMD
  104. HDIO_DRIVE_CMD:WRV failed: Input/output error
  105. outgoing cdb: 85 08 0e 00 00 00 01 00 00 00 00 00 00 40 ec 00
  106. ioctl(fd,SG_IO): Invalid argument
  107. Trying legacy HDIO_DRIVE_CMD
  108. write-read-verify = 0
  109. galahad:~/hdparm-9.38-wrv# ./hdparm --verbose -R 3 /dev/hdc
  110.  
  111. /dev/hdc:
  112. setting write-read-verify to 3
  113. outgoing cdb: 85 06 20 00 0b 00 03 00 00 00 00 00 00 40 ef 00
  114. ioctl(fd,SG_IO): Invalid argument
  115. Trying legacy HDIO_DRIVE_CMD
  116. HDIO_DRIVE_CMD:WRV failed: Input/output error
  117. outgoing cdb: 85 08 0e 00 00 00 01 00 00 00 00 00 00 40 ec 00
  118. ioctl(fd,SG_IO): Invalid argument
  119. Trying legacy HDIO_DRIVE_CMD
  120. write-read-verify = 0
  121.  
  122. The drive does seem to receive the commands, but doesn't accept them:
  123.  
  124. galahad:~/hdparm-9.38-wrv# dmesg
  125. ...
  126. hdc: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
  127. hdc: drive_cmd: error=0x04 { DriveStatusError }
  128. ide: failed opcode was: 0xef
RAW Paste Data