When the root partition is overcharged...
What are the consequences?
You don't managed to restart Apache, you don't get emails, you can't succeed to install a new software, you can not apply new release...
How to realise it?
With a simple command in SSH:
[user@nsXXXX user]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 1.9G 981M 887M 53% /
/dev/hda2 34G 3.8G 29G 12% /home
none 61M 0 61M 0% /dev/shm
Or in Webmin here: 'https://nsXXX.ovh.net:10000/fdisk/' or (if your Webmin is not in SSL): 'http://nsXXX.ovh.net:10000/fdisk/'
Causes
We call system partition, /, slash, or root partition, the partition where the base system is stored. The sites and everything that must be added to the server are in /home.
They are multiple:
- Backup of your sites in a directory other than a /home sub-directory,
- Unzip big archives in HOME directory of root (/root),
- Setup of massive software (for example online game server) in a directory belonging to the system partition (for example /usr),
- Bug of mod_gzip,
- Overflow of the email queue.
Solutions
For the first two cases, you just need to move the files/directories in a
/home sub-directory. To see the most massive files in a directory, you can execute the following command:
Head only allows to display the 10 more massive files.
[root@nsXXXX root]# ls -lh --sort=size|head
total 20M
-rw-r--r-- 1 root root 2.6M may 1 18:00 vim-common-6.1-18.7x.2.i386.rpm
-rw-r--r-- 1 root root 2.5M jui 22 10:15 mutt-1.4.1-1.src.rpm
-rw-r--r-- 1 root root 2.5M jui 22 10:33 mutt-1.4.1i-2mdk.src.rpm
-rw-r--r-- 1 root root 1.7M apr 9 2003 bind-9.2.1-1.7x.2.i386.rpm
-rw-r--r-- 1 root root 1.5M jui 18 14:25 tin-current.tar.gz
-rw-r--r-- 1 root root 1.4M apr 10 10:22 awstats-5.6-1.noarch.rpm
-rw-r--r-- 1 root root 1.1M jui 21 19:34 mutt-1.4.1-1.i386.rpm
-rw-r--r-- 1 root root 1.0M may 1 18:00 vim-enhanced-6.1-18.7x.2.i386.rpm
-rw-r--r-- 1 root root 908k jui 23 16:28 mutt-1.2.5.1-1.i386.rpm
Here, we note that:
- There is a 20MB file in this directory (the sub directories are not taken into account)
- The more massive file is vim-common-6.1-18.7x.2.i386.rpm: its size is 2.6MB
To solve the problem, we are going to place the bulky files in a directory on /
home. Visiblement, Visibly, these are
.rpm and
.tar.gz (softwares archives). You are not obliged to keep them in /
root. Therefore, we are going to creae a directory on /home to store them.
[root@nsXXXX root]# mkdir /home/archives
[root@nsXXXX root]# mv *.tar.gz *.rpm /home/archives
Overloading further to the setup of one or several massive software
For example, you have installed a HLDS server (Half-Life Dedicated Server) in
/usr/local/game/hlds. This directory is on the system partition, thus you have to move it on
/home and create a symbolic link in order the path to remain valid.
Warning: Make sure you stop the hlds server before the operation!
[root@nsXXXX root]# mv /usr/local/game/hlds /home/
[root@nsXXXX root]# ln -s /home/hlds /usr/local/game/hlds
Bug of mod_gzip
It may happen that mod_gzip doesn't delete its temporary files located in /tmp and that they reach an important size (several GB). To realise it:
[root@nsXXXX root]# ls -l /tmp/*.wrk
-rwx------ 1 nobody nobody 53695415 sep 30 00:10 _11831_132_33.wrk
-rwx------ 1 nobody nobody 0 sep 3 00:10 _12954_120_21.wrk
-rwx------ 1 nobody nobody 0 sep 7 00:10 _14733_110_11.wrk
-rwx------ 1 nobody nobody 0 sep 21 00:10 _16191_106_7.wrk
-rwx------ 1 nobody nobody 0 aoû 19 00:10 _16585_123_24.wrk
-rwx------ 1 nobody nobody 0 aoû 25 00:10 _16693_152_53.wrk
-rwx------ 1 nobody nobody 0 oct 5 00:10 _17282_110_11.wrk
-rwx------ 1 nobody nobody 0 sep 14 00:10 _17792_106_7.wrk
-rwx------ 1 nobody nobody 0 oct 7 00:10 _18056_108_9.wrk
To delete them:
[root@nsXXXX root]# rm -rf /tmp/*.wrk
This bug is known but its origin is not. For the moment, the only one solution to avoid it is to deactivate
mod_gzip in /
httpd.conf. Look for
mod_gzip yes line and replace it by
mod_gzip no. Then restart Apache that way:
[root@nsXXXX root]#/etc/init.d/httpd restart
This bug only occurrs for some site (probably due to a PHP or CGI script).
Overloaded mails queue
See the manual
QmailQueueFull