You can get a pretty good measure of this using the iostat
tool.
% iostat -dx /dev/sda 5
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 0.78 11.03 1.19 2.82 72.98 111.07 45.80 0.13 32.78 1.60 0.64
The disk utilisation is listed in the last column. This is defined as
Percentage of CPU time during which I/O requests were issued to the device
(band-width utilization for the device). Device saturation
occurs when this value is close to 100%.
(Warnings regarding automatic upgrades have already been voiced by previous posters.)
Given the track record of the Debian Security team in the last few years, I consider the risks of broken upgrades far less than the benefit of having automatic updates on seldom-visited systems.
Debian Lenny comes with unattended-upgrades, which originated from Ubuntu and is considered to be the defacto solution for unattended upgrades for Debian starting from Lenny/5.0.
To get it up and running on a Debian system you need to install the unattended-upgrades
package.
Then add these lines to /etc/apt/apt.conf
:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
(Note: In Debian Squeeze/6.0 there is no /etc/apt/apt.conf
. The preferred method is to use the following command, which will create the above lines in /etc/apt/apt.conf.d/20auto-upgrades
:)
sudo dpkg-reconfigure -plow unattended-upgrades
A cron job is then run nightly and checks if there are security updates which need to be installed.
Actions by unattended-upgrades can be monitored in /var/log/unattended-upgrades/
. Be wary, that for kernel security fixes to become active, you need to reboot the server manually. This can also be done automatically in course of a planned (e.g. monthly) maintenance window.
Best Answer
This is a bit tricky. There are actually lots of files that have active writes at any time...mostly logs...
There are some considerations as well. If you spin the drive down too many times, it will die in less than a year. So you'll want to keep a careful eye on how often it does spin up.
First, try enabling laptop mode in
/proc/sys/vm/laptop_mode
, this will have an effect on how data is written to disk. I don't have all the details on this, but my limited understanding is that it causes the I/O to build up and "wait until the last moment" to write to disk...so small writes tend to sit around in cache for some time.Next, be sure to set
/proc/sys/vm/swappiness
to something like 0. Every time you page from VM, you'll generate a disk I/O. Supressing your VM as much as possible will help with this regard. If you can take it to the extreme (you have like 3-4Gb of RAM) you can just disable swap partitions and files altogether, and this issue will go away.If your drives can still be seen as ATA devices and not SCSI (as SATA is wont to do) then you can use hdparm to set drive idle times.
I've written about this elsewhere, but if you're attempting to reduce I/O, you might need to set up /tmp as a RAM disk. I'm not 100% keen on this but it is a necessary step in getting the system to not write out to disk.
Debian has syslog sending a MARK to the logfile every 20 minutes. This will annoy you (and your hard drive) so you'll need to disable this as well.
More info on how to spin down drives can be found here.