How to Let Drives Spin Down

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
Actually spinning up drives sequentially is typically be design to reduce power surges on your power supply. Imagine if you have 20 drives and you tried to spin them all up at once. The power draw would be substantial and what if the power drop caused instability in your system. I prefer sequential powering up of my drives.


Is this for a clean virgin FreeNAS installation, no jails, nothing but a bare NAS running? Regardless of where your jails are located, if you have a shared space on the pool and the jail tries to access it, well things don't sleep very well. With some methodical testing I'd think you could figure this out. I am curious about the 3AM wake-up though, that could be something you can't get around if you have already moved your System Dataset and Jails/Plugins off the pool.

But in reality, there are a lot of folks here who can speak from personal experience, hard drives in general will last longer if you don't spin them up frequently. My drives are well over the 3 year warranty period and they run 24/7 with me shutting the system down a few times a year to blow any dust out of the case and power supply. I do have all my jails and System Dataset on the pool as well, it keeps the heads active which I prefer. I know I'm promoting just leaving your drives spinning, not the title of this thread. I'll stop peddling my wares now.
What typically fails from spinning the drives up and down? I read seagate tests their drives to 600,000 head park cycles. Is it the drives board or the motor for the platters?
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
I have my system plugged into a wattmeter and listen for the spin-ups. I also ran the smartctl -a -n standby /dev/daX and what it returns aligns with what the meter says. If the spin-down setting is in minutes, it must not work properly, or the APM setting overrides it. I do not have any jails installed, system dataset is on the boot drive and I do NOT have any jails installed. Changing the APM setting from 1 to 64 changes the power consumption to a sort of mid-level. I'm really curious what APM is actually doing?
It's possible the APM setting is overriding it. I don't really know what that does either, but I think it is manufacturer-specific. I would set it at 127 and see how the standby works. I can give you a script if you want that does the standby checking for all your disks at user-specified interval, also records temperature.
 

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
It's possible the APM setting is overriding it. I don't really know what that does either, but I think it is manufacturer-specific. I would set it at 127 and see how the standby works. I can give you a script if you want that does the standby checking for all your disks at user-specified interval, also records temperature.
That would be awesome except I'm a total newb and don't know what to do with a script.
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
That would be awesome except I'm a total newb and don't know what to do with a script.
You seem like a quick learner. Actually it is in the first post of this thread.
1. Copy the contents of the script from the post.
2. Paste it into a new plain text file. (Read the comments at the beginning of the script, you'll need to find some text in the output of 'camcontrol devlist' that finds your disks and excludes USB thumb drives and such.)
3. Save with the name spincheck.sh
4. Put it into your home directory on the FreeNAS.
5. Make it executable with chmod +x spincheck.sh
6. Run with sudo ./spincheck.sh (don't need sudo if you're logged in as root)
7. If you want a log file, run with sudo ./spincheck.sh | tee spincheck.log
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
What typically fails from spinning the drives up and down?
The drive motor or circuity powering the drive motor fails, that is the primary cause. Head loading is also a potential issue but not the lead cause.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
When it comes to APM, it depends on the hard drive and what it supports. If you look back into some of my earlier postings, you will find a lot of data on sleeping drives, APM and AAM settings and how to do these things manually. When I say earlier, I mean when FreeNAS 8.01 came out. There was a lot of tweaking the systems back then and scripts to make it all work the way you wanted. We use to compile our own custom versions of FreeNAS too.
 

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
You seem like a quick learner. Actually it is in the first post of this thread.
1. Copy the contents of the script from the post.
2. Paste it into a new plain text file. (Read the comments at the beginning of the script, you'll need to find some text in the output of 'camcontrol devlist' that finds your disks and excludes USB thumb drives and such.)
3. Save with the name spincheck.sh
4. Put it into your home directory on the FreeNAS.
5. Make it executable with chmod +x spincheck.sh
6. Run with sudo ./spincheck.sh (don't need sudo if you're logged in as root)
7. If you want a log file, run with sudo ./spincheck.sh | tee spincheck.log
Seems fairly simple. How do I copy it to the home directory? Once again, I am really only familiar with "windows" and I haven't seen any copy/paste buttons in FreeNAS. I don't think I can create a share for the freeNAS boot drive either.
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
Seems fairly simple. How do I copy it to the home directory? Once again, I am really only familiar with "windows" and I haven't seen any copy/paste buttons in FreeNAS. I don't think I can create a share for the freeNAS boot drive either.
If you have a share on the FreeNAS that includes your home directory (not the boot drive), just open it on your laptop or whatever and drag or paste the file in. If you don't have such a share, you might want to set one up as it will be handy.

Your home directory is likely /mnt/<volumeName>/<userName>. If you log in as root, I think it is just /root. It should be where you are by default when you ssh in.

Another option is to use a text editor on the FreeNAS like nano (you might have to install that with pkg install). You SSH into your home directory, type 'nano spincheck.sh', paste the contents of the file there, ^-o to save, confirm file name, and ^-x to exit.

A third option (last resort) is doing a copy over ssh using the scp command. I won't get into that, you can look it up if you need to.
 

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
If you have a share on the FreeNAS that includes your home directory (not the boot drive), just open it on your laptop or whatever and drag or paste the file in. If you don't have such a share, you might want to set one up as it will be handy.

Your home directory is likely /mnt/<volumeName>/<userName>. If you log in as root, I think it is just /root. It should be where you are by default when you ssh in.

Another option is to use a text editor on the FreeNAS like nano (you might have to install that with pkg install). You SSH into your home directory, type 'nano spincheck.sh', paste the contents of the file there, ^-o to save, confirm file name, and ^-x to exit.

A third option (last resort) is doing a copy over ssh using the scp command. I won't get into that, you can look it up if you need to.
Thank you, I will give it a try when I get home tonight, that is if I can get the wife and kid to leave me alone long enough....
 

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
If you have a share on the FreeNAS that includes your home directory (not the boot drive), just open it on your laptop or whatever and drag or paste the file in. If you don't have such a share, you might want to set one up as it will be handy.

Your home directory is likely /mnt/<volumeName>/<userName>. If you log in as root, I think it is just /root. It should be where you are by default when you ssh in.

Another option is to use a text editor on the FreeNAS like nano (you might have to install that with pkg install). You SSH into your home directory, type 'nano spincheck.sh', paste the contents of the file there, ^-o to save, confirm file name, and ^-x to exit.

A third option (last resort) is doing a copy over ssh using the scp command. I won't get into that, you can look it up if you need to.
Okay, so I do NOT believe I have a share setup for my home directory. I am trying to set one up, but I don't see anything pertaining to any username or root when I go to add share. I attached a picture if that helps.
Screenshot (1).jpg
 

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
Apparently I don't understand what exactly the home directory is. Not sure if this matters, but the system dataset file is setup to save to FreeNAS-boot drive
 

Mirfster

Doesn't know what he's talking about
Joined
Oct 2, 2015
Messages
3,215

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
When you create a user, you have an option to select/check "home directory"; then it will make it for you.

Sent from my ASUS Transformer Pad TF700T using Tapatalk
But I need to share the home directory for user "root" and it doesn't show as a user in the user list. I tried checking the home directory box and putting /root for the path for one of my users, but the GUI won't accept /root as an entry.
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
But I need to share the home directory for user "root" and it doesn't show as a user in the user list. I tried checking the home directory box and putting /root for the path for one of my users, but the GUI won't accept /root as an entry.
Are you saying you normally log in via SSH as root? and you never set up a user for yourself? I'm not sure the latter is possible.

It wouldn't make sense to use /root as the home directory for a non-root user anyway. Just use the default path for home directory for the user, or /mnt/MainVolume/<user>.

In the WebGUI, on the left side, go to Accounts > Users. Do you see your user account there? If so, double-click on it to see the settings. The fourth item should be Home Directory. If none is shown, can you create one there?

I don't think you can share root. If you really want to log in as root (not recommended), the script doesn't have to go into your home directory You can put it in someplace like /usr/local/sbin. But you will have to use one of the other methods I mentioned above, since you can't share those locations.
 

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
Yes, I have always logged in as root with ssh. I did setup a user for my windows machines, but home directory is set to /nonexistent. I changed that to /mnt/MainVolume/<user>. Then I created a share for /mnt/MainVolume/<user>, but when I try to map the network drive, windows tells me can't connect.
 

paylesspizzaman

Explorer
Joined
Sep 1, 2015
Messages
92
So I don't have write permissions for the home directory. I tried changing the owner of the dataset mainVolume to the user I am mapping the drive with in windows. Under permissions for the dataset the owner and group boxes are checked for write permission and the type is set to windows, I also set my user to the dataset owner. Under users I made sure the user has the group wheel and checked the box for write permissions under group, but when I go back, the box is unchecked. I also checked the box for Permit Sudo. After each change I disconnect the mapped drive and remapped it and none of this allowed me to write to the mapped drive.
 
Last edited:
Top