doug-gilbert / sdparm Goto Github PK
View Code? Open in Web Editor NEWofficial git-svn mirror for sdparm, access SCSI parameters (mode+VPD pages)
Home Page: https://sg.danny.cz/sg/sdparm.html
License: Other
official git-svn mirror for sdparm, access SCSI parameters (mode+VPD pages)
Home Page: https://sg.danny.cz/sg/sdparm.html
License: Other
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.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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.