Last active
January 9, 2024 20:17
-
-
Save tsjk/f636364c1d89a8f127998937c208b971 to your computer and use it in GitHub Desktop.
Disabling of sleep on external disk using sdparm so that they do not disconnect in middle of transactions (e.g. WD_My_Book_25ED)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: sdparm-disable_sleep.sh <device> | |
[[ -n "${1}" && -b "${1}" ]] \ | |
&& sdparm --flexible --page=po -l -a "${1}" \ | |
&& { sdparm --set=STANDBY_Z=0 -S "${1}" \ | |
&& sdparm --set=SZCT=$((45*60*100)) -S "${1}" \ | |
&& sdparm --flexible --page=po -l -a "${1}"; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't actually fix things completely, but might make it better. I for one will think twice before buying more Western Digital disks.