> cat /etc/systemd/system/fix-hdparm@.service
[Unit]
Description=Fix some hdparm settings after suspend/restore
After=dev-%i.device suspend.target hibernate.target sysinit.target hybrid-sleep.target
Requires=dev-%i.device
[Service]
Type=oneshot
ExecStart=/sbin/hdparm -B 254 /dev/%i
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
WantedBy=sysinit.target
# systemctl enable fix-hdparm@sda
ln -s '/etc/systemd/system/fix-hdparm@.service' '/etc/systemd/system/suspend.target.wants/fix-hdparm@sda.service'
ln -s '/etc/systemd/system/fix-hdparm@.service' '/etc/systemd/system/hibernate.target.wants/fix-hdparm@sda.service'
ln -s '/etc/systemd/system/fix-hdparm@.service' '/etc/systemd/system/hybrid-sleep.target.wants/fix-hdparm@sda.service'
ln -s '/etc/systemd/system/fix-hdparm@.service' '/etc/systemd/system/sysinit.target.wants/fix-hdparm@sda.service'
vasily_pupkin ★★★★★ ()