There are many running services in your MBWE that access the disks, thus making it spin up when it really shouldn't. I addition, they are using memory, which the MBWE doesn't have to spare. Here we'll turn some of them off.
A text editor and the know-how to use it. I recommend installing nano
, but vi
will also do just fine.
Make sure you are in superuser mode
# su
Disable mionet. It uses lots of memory. If you really want to securely access your MBWE from anywhere, I strongly recommend using SSH/SFTP.
In order to prevent mionet from starting during boot, edit /etc/init.d/mionet.sh
. Comment out this line:
$MIONETD start
Then stop the service:
# /etc/init.d/mionet.sh stop
Disable the cron job that is writing the time to a file. I really haven't figured out where the file is even used.
Edit /etc/crontabs/root
. Comment out the only line that can be commented out (if you havent set any cron jobs of your own)
Disable the service that displays the disk usage with the leds in the front panel of your MBWE. Admit it, the feature is pretty much useless and because the service has to check the amount of free space on the disk(s), it is causing disk access.
In order to prevent the service from starting during boot, edit /etc/init.d/S15wdc-fuel-gauge
. Comment out this line:
$FGD &
Then stop the service:
# /etc/init.d/S15wdc-fuel-gauge stop
Disable the default temperature monitoring service. More on that in the next section.
Disable syslogd
and klogd
. If you don't know what they are used for, you won't need them. And, you can always start them if you need to debug something.
Of course, you could move the logs to your ramdisk (see next step), but the busybox version of syslogd
doesn't support a syslog.conf
configuration file that could be used to move the logfiles to another location. So you would need to update Update: the busybox version of syslogd
to do that.syslogd
has a custom switch to define alternative location for the log file. If you want to keep syslogd
running and have it output the log file on your RAM disk, see the RAM disk guide for details.
To prevent them from starting, edit /etc/inittab
. Comment out these lines:
::respawn:/sbin/syslogd -n -m 0 ::respawn:/sbin/klogd -n
Reboot.
Disable ntpd
log. You really don't need to know that stuff.
Edit /etc/ntp.conf
; just point the logfile to /dev/null
logfile=/dev/null
Restart ntpd
to reload the configuration.
# /etc/init.d/ntp.sh restart
Of course, you could disable the whole ntpd
and update the clock only during boot or with a cron job. But it is up to you.
Create a RAM disk and keep the most frequently accessed stuff there.
This tutorial is on it's own page; Creating a RAM disk.
While we're at it, we might free some memory also... like about 20% of the total memory of your MBWE.
To keep the disks spinned down, having as much free memory as possible is essential. The accessed files are cached in memory as long as the memory isn't needed for something else, thus having more free memory means more files in cache means less disk access means disks don't spin up when the files are found in memory.
When the built-in web server is started, the web interface is also started to the background in order to keep it fast and snappy. The problem is, it takes memory almost 8 megabytes of the total 30 megabytes of the box. So if you're not planning on using the web interface a lot, you might just as well disable the whole damn thing, right?
If you're planning on using the web server for other purposes, you'll just want to disable the web interface. Find the following line in /etc/lighttpd/lighttpd.conf
and comment it out:
"bin-path" => "/usr/www/lib/nasMaster.pl"
Then restart the web server by
# /etc/init.d/lighttpd.sh restart
...and you're done.
If you won't be using the whole web server, you can stop the whole damn thing by
# /etc/init.d/lighttpd.sh stop
And prevent it from starting during boot by commenting out all the lines in /etc/init.d/network_servers.sh
calling lighttpd.sh
.
It is also possible to make lighttpd
start only on demand.
Just an idea:
Copy the whole system to an USB stick and run it from there. Frequently written files could be kept on a ram disk (see previous step) to maximize the USB stick's lifetime.
Alternatively, copy the system to an USB hard drive that by default knowns how to spin down properly and run it from there :)
I haven't really tried this, it's just an idea. This would really minimize disk access, if it was possible. And why wouldn't it be, this is linux we're talking about here :)
Any ideas concerning this would be appereciated...
The needed steps would be:
1. Clone system files to an USB stick. My current system files take about 350 megabytes of space, so a 512 MB stick should be enough.
2. During boot, check if there is an USB drive plugged in and if it contains the system files. Could also perform some checks to ensure the stick is healthy.
3. chroot
to the stick and continue running the system from there.