Posted: Mon Apr 13, 2020 20:39 Post subject: Check if disk is active?
Hey guys. Thanks for everything. This is my first post, but I have used these forum posts every step of the way, and I appreciate it very much.
I have a Netgear R8000 running v3.0-r37015M kongac (09/23/18).
I have a USB hard drive dock with 2 drives connected running in JBOD. I'm unable to set standby for the drives with hdparm or sdparm (I assume because they'e connected to a single device?) They run 24/7, which is unnecessary for drives I'm accessing maybe 10-20 hours a week.
I am able to manually stop the drives with sdparm. Commanding EITHER drive to stop results in BOTH drives spinning down. I could have a script do this for me every hour, but I don't want the drives stopped if I'm using them.
How can I check if the drive (or the USB device) is being used before I have the router stop the drive?
Or if you think my approach is dumb, I'm happy to hear suggestions for other approaches.
Joined: 26 Mar 2013 Posts: 1858 Location: Hung Hom, Hong Kong
Posted: Sat Apr 25, 2020 18:44 Post subject: Re: Check if disk is active?
realbobross wrote:
How can I check if the drive (or the USB device) is being used before I have the router stop the drive?
Just write "BUSY" into a text file in the external drive and read it back by a process in the router, say, a cron job. When you are done, echo "DONE" into that file to signal the cron job to stop the drive.
BTW, you can use cron job to wake up the drive in specific time as well by writing a date and time into that same text file.
You can also set up a cron process to monitor a particular TCP/IP port and wait for a text message to wake up the drive anytime. Netcat can do that. Another method to use port knocking in iptables by scanning the system log.
_________________ Router: Asus RT-N18U (rev. A1)
Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!