Hey all,
I have a ZFS pool in my proxmox box consisting of Seagate Enterprise drives.
They accept the smartctl -l scterc command to set the error recovery timeout, but unfortunately for some reason it is not persistent after reboot.
While reboots are infrequent, I don't want to forget to lower the default timeout when I do reboot, so I created a small script (well, less of a script and more of a list of commands) to run @reboot in cron.
the script looks like this:
It has been added to my root crontab as follows:
If triggered manually, the sript works just fine, using smartctl to set the timeout for every disk in the pool, but at reboot not so much.
I just rebooted for the first time since setting it up, and got th efollowing notification in my email:
As expected following this email, when I log on and check the scterc values, they have not been set as desired.
So for some reason, at reboot, the script cannot find the smartctl command? Does this @reboot command happen too hearly, before the binary path has been set, or maybe before smartd has properly started?
If so, how can I delay the execution to a point in time when it will work? Will a sleep line in my script do it, or will that just slow the boot and still be ineffective?
Or is ther something else going on here?
I appreciate any suggestions!
I have a ZFS pool in my proxmox box consisting of Seagate Enterprise drives.
They accept the smartctl -l scterc command to set the error recovery timeout, but unfortunately for some reason it is not persistent after reboot.
While reboots are infrequent, I don't want to forget to lower the default timeout when I do reboot, so I created a small script (well, less of a script and more of a list of commands) to run @reboot in cron.
the script looks like this:
Code:
# cat scterc.sh
#!/bin/bash
smartctl -l scterc,20,20 /dev/disk/by-id/ata-ST10000NM0016-1TT101_Serial#1
smartctl -l scterc,20,20 /dev/disk/by-id/ata-ST10000NM0016-1TT101_Serial#2
smartctl -l scterc,20,20 /dev/disk/by-id/ata-ST10000NM0016-1TT101_Serial#3
smartctl -l scterc,20,20 /dev/disk/by-id/ata-ST10000NM0016-1TT101_ETC
It has been added to my root crontab as follows:
Code:
# m h dom mon dow command
@reboot /root/scterc.sh
If triggered manually, the sript works just fine, using smartctl to set the timeout for every disk in the pool, but at reboot not so much.
I just rebooted for the first time since setting it up, and got th efollowing notification in my email:
Code:
Title: Cron <root@proxmox> /root/scterc.sh
Cron Daemon <root@proxmox.home.local>
1:00 AM (10 hours ago)
to root
/root/scterc.sh: line 2: smartctl: command not found
/root/scterc.sh: line 3: smartctl: command not found
/root/scterc.sh: line 4: smartctl: command not found
/root/scterc.sh: line 5: smartctl: command not found
/root/scterc.sh: line 6: smartctl: command not found
/root/scterc.sh: line 7: smartctl: command not found
/root/scterc.sh: line 8: smartctl: command not found
/root/scterc.sh: line 9: smartctl: command not found
/root/scterc.sh: line 10: smartctl: command not found
/root/scterc.sh: line 11: smartctl: command not found
/root/scterc.sh: line 12: smartctl: command not found
/root/scterc.sh: line 13: smartctl: command not found
As expected following this email, when I log on and check the scterc values, they have not been set as desired.
So for some reason, at reboot, the script cannot find the smartctl command? Does this @reboot command happen too hearly, before the binary path has been set, or maybe before smartd has properly started?
If so, how can I delay the execution to a point in time when it will work? Will a sleep line in my script do it, or will that just slow the boot and still be ineffective?
Or is ther something else going on here?
I appreciate any suggestions!