Check if disk is active?

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
realbobross
DD-WRT Novice


Joined: 13 Apr 2020
Posts: 1

PostPosted: Mon Apr 13, 2020 20:39    Post subject: Check if disk is active? Reply with quote
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.

Thanks
Sponsor
KarlUClark
DD-WRT Novice


Joined: 23 Apr 2020
Posts: 1

PostPosted: Thu Apr 23, 2020 13:11    Post subject: re Reply with quote
Thanks for sharing this post.
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1418

PostPosted: Thu Apr 23, 2020 22:31    Post subject: Reply with quote
What options are you running?

Are multiple people accessing the drive or just you?
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1858
Location: Hung Hom, Hong Kong

PostPosted: Sat Apr 25, 2020 18:44    Post subject: Re: Check if disk is active? Reply with quote
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!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum