Slackware external drive cronjob help
Hi guys,
I bought a cheap external enclosure for my 2tb hard drive and it is working fine, but the thing keeps going to sleep every 5 or so minutes of inactivity. The enclosure doesn't support advanced power features so I want to make a cronjob to write a zero byte or "ls" the top directory every few minutes to keep it awake, I tried a cronjob that touches the drive every few minutes but its not keeping it awake, so I need a new idea Thanks in advance. |
fdisk usually wakes things up
|
Does `hdparm -S 0 -B 251 /dev/sdX' work with this drive? If '-S 0' doesn't work, try high values (RTFM for details), like '-S 251'.
What is wrong with energy-saving anyway? If you access the drive less then 12 times per hour, why shouldn't it sleep? Maybe you should try even shortening the inactivity timeout down to fifteen seconds? -- Cheers, backblaze.pl |
Quote:
hdparm -S 0 -B 251 /dev/sdc /dev/sdc: setting Advanced Power Management level to 0xfb (251) HDIO_DRIVE_CMD failed: Input/output error setting standby to 0 (off) HDIO_DRIVE_CMD(setidle) failed: Invalid argument APM_level = not supported my only option is a cronjob. |
A cron job doing an ls on the drive sounds feasible. Have you tried it? Did you get stuck? If so, where did you get stuck?
|
MrGoblin has already suggested fdisk. Have you tried 'fdisk -l >/dev/null 2>&1' ?
|
How does the enclosure control the hard drive as described? A link describing the enclosure hardware might help explain what is happening. Possibly a link describing the hard drive too.
|
Sorry for the late reply, I should of been more specific about my cronjob. I have never had to use a cronjob until now, so I guess my question what is the best method to make a cronjob, Right now I just added */1 * * * * ls /mnt/backup &>/dev/null to my /etc/rc.d/rc.local. Is this method ok or is there a better way?
Thanks. |
Quote:
|
Yes I did add it rc.local. Thats how I think I screwed up, I am reading man pages on crontab right now. I should know how to do this but ironically I have never had a to use cron until now.
|
Yeah, run 'crontab -e' and it'll open in vi and you can put your commands there.
One of the gotchas with crontab to be aware of is that is doesn't have the full system environmental variables like $PATH, so it's always good practice to put the full path of any program you need to run. /bin/ls (actually that one may work without the path but you get the idea). |
All times are GMT -5. The time now is 02:35 AM. |