SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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?
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
Nothing is wrong with energy saving but all my files are on the drive so I access it constantly. I have tried the above command before and like I said the enclosure does not support advanced power features. I get errors like this
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
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?
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.
I'm not sure I understand. You added the cron command to rc.local? This is definitely not OK. You need to run 'crontab -e' and add it there.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.