Put Jail /tmp and /var/tmp in memory?

Status
Not open for further replies.

smufu

Cadet
Joined
Apr 17, 2013
Messages
4
As my disk don't spin down your second option would be the way I'll investigate.

If however your disks continue to spin up even with this fix in place, then you need to track down what process is reading/writing to your disks, and where, then see if there is a way to prevent it.

Could you give me a hint how I could determine which processes/daemons/files [...] are working inside the jail and prevent the spin down?
I'm pretty new to FreeNAS so I'd appreciate if you could give me some commands or stuff.
Currently just miniDLNA is running in the jail, and the setup itself is very young.

Regards,
smufu
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
As my disk don't spin down your second option would be the way I'll investigate.

You should be able to force them to spin down, run "ataidle -s <device>" on each disk, then test. You could of course shutdown (stop) all the software you have running in your jail while you perform this test.

Could you give me a hint how I could determine which processes/daemons/files [...] are working inside the jail and prevent the spin down?
I'm pretty new to FreeNAS so I'd appreciate if you could give me some commands or stuff.
Currently just miniDLNA is running in the jail, and the setup itself is very young.

Regards,
smufu

No really, it depends entirely on what software you are running and how that software operates (where it writes its files, what logs it uses etc., how it uses /tmp). You need to understand the software you are running, and work from there. I'm not familiar with miniDLNA. There's also a bunch of standard cron jobs that you probably want to stop running, as these will spin up the disks at regular intervals.
 

smufu

Cadet
Joined
Apr 17, 2013
Messages
4
No really, it depends entirely on what software you are running and how that software operates (where it writes its files, what logs it uses etc., how it uses /tmp). You need to understand the software you are running, and work from there. I'm not familiar with miniDLNA. There's also a bunch of standard cron jobs that you probably want to stop running, as these will spin up the disks at regular intervals.
I didn't any test till now, but I got one problem in mind ....
Hope this is no stupid question as my understanding of how FreeNAS (Jails) works is not jet perfect :)

How can I have a look which processes run in the jail, without beeing in the jail and so preventing the drive spin down?
Know what I mean ... ?
Thanks in advance

smufu
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
ps aux? For instance, outside the jail I can run "ps aux|grep mysql":

Code:
88         24573  0.0  0.0  8348     744  ??  IsJ   4Apr13   0:00.02 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/software.pid
88         24706  0.0  1.4 238404 111812  ??  IJ    4Apr13 342:17.77 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --datadir=/var/db/mysql --plugin-dir=/usr/local/lib/mysql/plugin --log-error=/var/db/mysql/software.err --pid-file=/var/db/


The "unusual" uid (88) is indicative of a jail account, I'm also guessing STAT flag "J" is suggestive of a jail process. Whether you are in our out of the jail is unlikely to have much effect on whether your drives spin up, to be honest - they're as likely to do that with you outside of the jail as in it.
 

smufu

Cadet
Joined
Apr 17, 2013
Messages
4
ps aux? For instance, outside the jail I can run "ps aux|grep mysql":
Ok, I did a test on my FreeNAS.
I stopped all disk with the ataidle command and started a top.
At the Moment of spinning up it looks like the process php-fpm is comming up.
As far as I investigate the process belongs to the minidlna Plugin. Should this process allready be covered with your fix Milhouse?

Greets
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Like I said, I'm not familiar with miniDLNA - you need to work out what folders that process is reading/writing and include/exclude as appropriate. If it's writing outside of /tmp, /var/tmp, and /var/log it's likely that whatever is being written is persistent and probably something you want to keep (anything in the memory backed disk is lost when the jail is stopped). If you don't need to persist whatever is being written, then see if you can configure miniDLNA to use /tmp (or /var/tmp) as a scratch area.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Ok, I did a test on my FreeNAS.
I stopped all disk with the ataidle command and started a top.
At the Moment of spinning up it looks like the process php-fpm is comming up.
As far as I investigate the process belongs to the minidlna Plugin. Should this process allready be covered with your fix Milhouse?

Greets
If you feel this is a MiniDLNA related issue (turn off MiniDLNA to verify your diagnosis), my tagline has a link to a MiniDLNA fix thread that might be of interest to you. In general, if you are running a stock MiniDLNA configuration with a normal DLNA compliant client, you shouldn't have any issues with the spinup of the drives until one of those clients are looking to read data, this is normal.
 

timgarner0

Cadet
Joined
Sep 20, 2012
Messages
2
Has anyone else tried this patch on 9.1.1-RELEASE? I receive the following error when attempting to patch:

Code:
[root@freenas] /conf/base/etc/rc.d# patch ix-jail /root/ix-jail.patch
Hmm...  Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** ix-jail.orig      Tue Oct 23 11:06:10 2012
|--- ix-jail    Sat Oct 27 03:46:00 2012
--------------------------
Patching file ix-jail using Plan A...
Hunk #1 failed at 50.
Hunk #2 failed at 68.
Hunk #3 failed at 114.
Hunk #4 failed at 215.
4 out of 4 hunks failed--saving rejects to ix-jail.rej
done


I assume this is because the ix-jail script has changed considerably since 8.x. Unless anyone else has already updated the script I will have a go.
 

Ben13

Cadet
Joined
Jan 27, 2015
Messages
7
Hi,
I'm new to freenas and trying for weeks to get my HDDs spin down. I read a lot of posts and already moved my System Dataset to a USB stick. After that my HDDs spin down as expected. But when I turn on the jails the HDDs won't spin down anymore. My only hope was this patch but it won't work with FreeNAS-9.3-STABLE-201502050159, obviously because there is no ix-jail in /conf/base/etc/rc.d/ anymore.
Is someone able to post a guide how to move the logging (or whatever the jail does to prevent spin down) to another Pool (USB) or in the Memory?
I'm thinking about an approach like on this site: http://blog.raphaelabreu.com/2013/03/struggling-with-freenas-power-consumption-optmization/

If it helps, this is the output when I try to apply the patch:
Code:
[root@freenas] /conf/base/etc/rc.d# patch ix-jail /mnt/Volume/Home/Freenas/ix-jail.patch
Hmm...  Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** ix-jail.orig       Tue Oct 23 11:06:10 2012
|--- ix-jail    Sat Oct 27 03:46:00 2012
--------------------------
patch: **** can't find ix-jail


I also found out, that when I kill cone with
Code:
killall cron

the HDDs spin down again as expected with the jail running.
But when I additionally tun on my Plexplugin the HDDs won't spin down again, but I think that could be something in the Plex settings.
 
Status
Not open for further replies.
Top