How to verify my drive is "spinning down"

Discussion and Technical Support for general software applications and utilities including OS related issues.
fpp
Member
Member
Posts: 54
Joined: July 28th, 2011, 9:27 pm

Re: How to verify my drive is "spinning down"

Post by fpp »

I am actually seeing a similar problem now.

If I manually spin down my data drives with hdparm -y they will stay that way for a little while (a couple of minutes at most) then come up again.

I have nothing installed that's not on your list (a lot less, really). I remember that in the early stages of installation the disks would stay down until I actually accessed them.

Main items added since were Samba shares (mounted on Windows clients) and FlexRAID itself (in snapshot mode). Which could be the culprit ?...
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: How to verify my drive is "spinning down"

Post by Ian »

Hi fpp,

It's possible one of your windows clients is waking up the drive(s). As a test either remove the network cable from your server and see whether the problem goes away and/or unmap the drive(s) from all your windows clients. If you access your server in Windows Explorer using My Network Places|Microsoft Windows Network|.......... then a connection can remain even after you've finished looking at the drive. So, from Explorer choose Tools|Disconnect Network Drive and remove any old connections.

If the above doesn't help then the cause is something on the server itself. I had an issue with SMART a while back, are you running SMART on your server?

I have no issues with FlexRAID keeping drives awake so I doubt it's that.

I do have a streamer that prevents my drives spinning down even when it's on standby.

Ian.
fpp
Member
Member
Posts: 54
Joined: July 28th, 2011, 9:27 pm

Re: How to verify my drive is "spinning down"

Post by fpp »

Thanks for the tip ! I did have of of those "direct links" left over from before I assigned drive letters to the shares.

I just deleted it and spun down the drives again, we'll see...

EDIT: Drat, no dice...

They all came back on in less than 5 minutes. All three DRUs, and the PPU, on which there is no share, and at the same time. This must be something system-wide...

What do you mean by "SMART" ? The smartd daemon the comes with smartctl, or something else ? I don't think I've installed anything such, at least consciously :-)
LarryJB
Member
Member
Posts: 58
Joined: April 8th, 2011, 2:29 pm

Re: How to verify my drive is "spinning down"

Post by LarryJB »

Ian wrote:Hi Larry,

Rather than change the hdparm.conf file try issuing the "hdparm -S 4 /dev/sdb" command in a Putty session. It's possible the process is not being run at boot. Does it make a difference?

Ian.

Yeah, that did make a difference. I now shows standby. Must be the process. I will check that out.
Larry Browning
Linux newbie, but having fun and learning!
There are 10 kinds of people; those who understand binary and those that don't.
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: How to verify my drive is "spinning down"

Post by Ian »

Here's a little script that will set the drive spindown time to 30 minutes. You could run it as a cron job at boot time. Edit the "MyList='b c d e f'" line to suit the drives you have in your setup.

Code: Select all

#!/bin/bash
# PURPOSE: Set spindown time on Drives to 30 minutes

MyList='b c d e f'
echo 'Setting all drives'

sleep 60

for i in $MyList
do
  echo 'Drive /dev/sd'$i
  /sbin/hdparm -S 241 /dev/sd$i
done
fpp
Member
Member
Posts: 54
Joined: July 28th, 2011, 9:27 pm

Re: How to verify my drive is "spinning down"

Post by fpp »

In my post above I may have tried too soon after deleting the direct connection.

Later on I spun the disks down again and they stayed put.

After being "woken" at night by FlexRAID for the scheduled update, they stayed active, so the hdpam.conf doesn't seem to work here either.
I will adapt your script above to use labels and try the cron way too.
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: How to verify my drive is "spinning down"

Post by Ian »

fpp wrote:In my post above I may have tried too soon after deleting the direct connection.

Later on I spun the disks down again and they stayed put.

After being "woken" at night by FlexRAID for the scheduled update, they stayed active, so the hdpam.conf doesn't seem to work here either.
I will adapt your script above to use labels and try the cron way too.


As I posted that script I did think of your issue with the drive letters changing round but figured that script would be fine for some people. I'll look into drive labels and update all my scripts as required.

Ian.
fpp
Member
Member
Posts: 54
Joined: July 28th, 2011, 9:27 pm

Re: How to verify my drive is "spinning down"

Post by fpp »

Here's an example for hdparm as above :
MyList='DRU1 DRU2 DRU3 PPU0'
echo ''
echo 'Setting data drives spin down delay'

for i in $MyList
do
hdparm -S 240 /dev/disk/by-label/$i
done


...and one for smartctl (disk temps) :
MyList='SSD DRU1 DRU2 DRU3 PPU0'
echo ''
echo 'Drive temperatures:'

for i in $MyList
do
#Check state of drive 'active/idle' or 'standby'
stra=$(/sbin/hdparm -C /dev/disk/by-label/$i | grep 'drive' | awk '{print $4}')

if [ ${stra} = 'standby' ]
then
echo ' '$i ': standby'
else
str1='/usr/sbin/smartctl -n standby -A -d ata /dev/disk/by-label/'$i
str2=$($str1 | grep "194 Temp" | awk '{print $10}')
echo ' '$i ': '$str2
fi
done

(note the extra '-d ata' argument here)
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: How to verify my drive is "spinning down"

Post by Ian »

Thanks :thumbup:
User avatar
phour19
Member
Member
Posts: 6
Joined: September 30th, 2011, 3:00 am

Re: How to verify my drive is "spinning down"

Post by phour19 »

Ian wrote:Hi fpp,

It's possible one of your windows clients is waking up the drive(s). As a test either remove the network cable from your server and see whether the problem goes away and/or unmap the drive(s) from all your windows clients. If you access your server in Windows Explorer using My Network Places|Microsoft Windows Network|.......... then a connection can remain even after you've finished looking at the drive. So, from Explorer choose Tools|Disconnect Network Drive and remove any old connections.

If the above doesn't help then the cause is something on the server itself. I had an issue with SMART a while back, are you running SMART on your server?

I have no issues with FlexRAID keeping drives awake so I doubt it's that.

I do have a streamer that prevents my drives spinning down even when it's on standby.

Ian.



I just mapped my server as a network drive. Does this mean it will cause the HDD to always spin? When I mapped it I unchecked the reconnect at login hoping that might help?
Post Reply