1. Yes, if /lib/systemd/system-sleep/ doesn't exist, create it with mkdir.
2. Yes.
3. No, unless for some reason you want to limit the script to suspend only, or something. Here's my script:
#!/bin/sh
case $1/$2 in
pre/*)
;;
post/*)
hdparm -B 254 -S 120 /dev/sdb
;;
esac
1. Yes, if /lib/systemd/ system- sleep/ doesn't exist, create it with mkdir.
2. Yes.
3. No, unless for some reason you want to limit the script to suspend only, or something. Here's my script:
#!/bin/sh
case $1/$2 in
pre/*)
;;
post/*)
hdparm -B 254 -S 120 /dev/sdb
;;
esac
4. Yes, with chmod u+x <filename>.