0

I have a fairly old hard drive that I want to have spin down after say 30 or 60 minutes of inactivity. I flipped the web and found that I can set spin down time with hdparm -S and I tried that, setting it to 5 seconds - the lowest possible - but the drive does not appear to spin down. After issuing hdparm -Y it immediately spins down. I'm assuming that simply the drive does not support a "spin-down" feature, which seems kind of unlikely TBH - I can't see the model exactly but it's a 750GB WD from around 2007.

What I thought of was if I can get the time at which the disk was last accessed, I can run a cron and put it to sleep with hdparm -Y.

How can I get the last access time of a hard drive?

1 Answer 1

0

You can monitor i/o of a device with iosnoop. Monitoring sda for example:

# iosnoop -ts -d "8,0"                                                     
Tracing block I/O. Ctrl-C to end.
STARTs          ENDs            COMM         PID    TYPE DEV      BLOCK        BYTES     LATms
340208.638093   340208.654477   rsync        10244  RM   8,0      1814496      16384     16.38
340208.654523   340208.665321   <idle>       0      RM   8,0      1814464      16384     10.80
340208.725234   340208.749223   rsync        10245  RM   8,0      86260504     4096      23.99
340208.750150   340208.756908   rsync        10245  RM   8,0      86263552     4096       6.76

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .