Coder Social home page Coder Social logo

doug-gilbert / sdparm Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 5.0 6.17 MB

official git-svn mirror for sdparm, access SCSI parameters (mode+VPD pages)

Home Page: https://sg.danny.cz/sg/sdparm.html

License: Other

Makefile 0.39% Shell 2.97% M4 0.30% C 96.34%
scsi mode-pages vpd-pages housekeeping command-line storage

sdparm's People

Contributors

doug-gilbert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sdparm's Issues

Can't query APM value on Windows

Hi, thanks a lot for your utility.
I'm trying to read the current APM value for my HDD, but I'm getting an error.

My OS:
Windows 8.1 x64

PD1:
WDC WD10JPVX-22JC3T0

D:\utils\sdparm>sdparm_64 -vv PD1
>>> about to open device name: PD1
    inquiry cdb: 12 00 00 00 24 00
    PD1: WDC       WD10JPVX-22JC3T0  01.0
    mode sense (10) cdb: 5a 00 01 00 00 00 00 00 08 00
sg_get_mode_page_controls: given response length too small, offset=8 given_len=8
 bd_len=0

>> Read write error recovery mode page [0x1] failed
    mode sense (10) cdb: 5a 00 02 00 00 00 00 00 08 00
sg_get_mode_page_controls: given response length too small, offset=8 given_len=8
 bd_len=0

>> Disconnect-reconnect (SPC + transports) mode page [0x2] failed
    mode sense (10) cdb: 5a 00 03 00 00 00 00 00 08 00
sg_get_mode_page_controls: given response length too small, offset=8 given_len=8
 bd_len=0

>> Format (SBC) mode page [0x3] failed
    mode sense (10) cdb: 5a 00 04 00 00 00 00 00 08 00
sg_get_mode_page_controls: given response length too small, offset=8 given_len=8
 bd_len=0

>> Rigid disk (SBC) mode page [0x4] failed
    mode sense (10) cdb: 5a 00 05 00 00 00 00 00 08 00
sg_get_mode_page_controls: given response length too small, offset=8 given_len=8
 bd_len=0

(...) And many other errors like above

When trying specifically to read the APM:

D:\utils\sdparm>sdparm_64 -vv -g APM PD1
mp_settings: page,subpage=0x1a,0xf1  num=1
  [0x1a,0xf1]  pdt=-1 start_byte=0x6 start_bit=7 num_bits=8  val=0  acronym: APM

>>> about to open device name: PD1
    inquiry cdb: 12 00 00 00 24 00
    PD1: WDC       WD10JPVX-22JC3T0  01.0
    mode sense (10) cdb: 5a 00 1a f1 00 00 00 00 08 00
sg_get_mode_page_controls: given response length too small, offset=8 given_len=8
 bd_len=0

APM error in SAT ATA Power condition mode page

Is there anything else that I can do to try to fix this? Eventually I want to be able to change this APM value as it resets per Windows session.

v1.12 exit code 5 on `--get WCE` command

v1.10 and v1.12 yield the same output on similar hardware but exit code is different.

[root@xyz ~]# sdparm --version
version: 1.10 20160222 [svn: r279]

[root@xyz ~]# sdparm --get WCE /dev/sdy --verbose; echo "exit code" $?
mp_settings: page,subpage=0x8,0x0  num=1
  [0x8,0x0]  pdt=0 start_byte=0x2 start_bit=2 num_bits=1  val=0  acronym: WCE
    /dev/sdy: ATA       WDC  WUH721818AL  W233
WCE           1  [cha: y]
exit code 0
[root@abc ~]# sdparm --version
version: 1.12 20210421 [svn: r347]

[root@abc ~]# sdparm --get WCE /dev/sdy --verbose; echo "exit code" $?
mp_settings: page,subpage=0x8,0x0  num=1
  [0x8,0x0]  pdt=5120 start_byte=0x2 start_bit=2 num_bits=1  val=0  acronym: WCE
    /dev/sdy: ATA       WDC  WUH721818AL  W233
WCE           1  [cha: y]
exit code 5

I did a quick strace diff between the 2 versions and find nothing significant.

Exit code 5 according to man pages:

the DEVICE reports an "illegal request" with an additional sense code other than "invalid operation code". This is often a supported command with a field set requesting an unsupported capability. For commands that require a "service action" field this value can indicate that the command is not supported.

I thought perhaps WCE isn't a supported capability but I can change the bit just fine.

[root@abc ~]# sdparm --set WCE=0 /dev/sdy --verbose; echo "exit code" $?
mp_settings: page,subpage=0x8,0x0  num=1
  pdt=5120 start_byte=0x2 start_bit=2 num_bits=1  val=0  acronym: WCE
    /dev/sdy: ATA       WDC  WUH721818AL  W233
    mode sense(10) cdb: [5a 00 08 00 00 00 00 00 04 00]
    mode sense(10) cdb: [5a 00 08 00 00 00 00 00 24 00]
    mode select(10) cdb: [55 10 00 00 00 00 00 00 24 00]
exit code 0

[root@abc ~]# sdparm --get WCE /dev/sdy --verbose; echo "exit code" $?
mp_settings: page,subpage=0x8,0x0  num=1
  [0x8,0x0]  pdt=5120 start_byte=0x2 start_bit=2 num_bits=1  val=0  acronym: WCE
    /dev/sdy: ATA       WDC  WUH721818AL  W233
WCE           0  [cha: y]
exit code 5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.