Warning: The disk usage for one or more of your partitions is running low

xoox

Verified User
Joined
Oct 24, 2008
Messages
52
How many times this week I received a warning email messages
I connected to admin user and I saw on the "Complete Usage Statistics" the following lines

Code:
Filesystem 	Size 	Used 	Avail 	Use% 	Mounted on
/dev/mapper/vg_*-lv_home	337G	65G	255G	21%	/home
/dev/mapper/vg_*-lv_root	50G	45G	2.7G	95%	/
/dev/sda1	485M	36M	424M	8%	/boot
tmpfs

Is it critical?
How do I fix this?
 
Hello,

You should free some space on root partition (i.e. /):

Code:
/dev/mapper/vg_*-lv_root	50G	45G	2.7G	95%	/

To see what takes space, you should login via SSH as root and run this commands:

Code:
cd /
du -h -x --max-depth=1 ./

it will list all directories and show how much disc space does each one takes. Then find the biggest, change directory and run again.

Or post results here.
 
Code:
[root@*~]# cd /
[root@*/]# du -h -x --max-depth=1 ./
0       ./dev
0       ./sys
45M     ./etc
7.7M    ./bin
1.6M    ./tmp
4.0K    ./mnt
2.1G    ./usr
0       ./misc
120M    ./lib
22M     ./root
4.0K    ./srv
4.0K    ./cgroup
4.0K    ./media
0       ./net
2.0K    ./boot
14M     ./sbin
4.0K    ./home
42G     ./var
0       ./proc
16K     ./lost+found
4.0K    ./opt
26M     ./lib64
4.0K    ./selinux
45G     ./



After that I connect with WinSCP and I saw that there was something there that catches ... Everything is empty
There are only 4 files
Code:
aquota.group
aquota.user
. autofsck
. autorelabel





Code:
[root@* /]# cd /var/
[root@* var]# du -h -x --max-depth=1 ./
4.0K    ./tmp
4.0K    ./cvs
4.0K    ./crash
8.0K    ./empty
248K    ./run
4.0K    ./games
38M     ./cache
4.0K    ./logs
8.0K    ./db
42G     ./lib
5.1M    ./named
12K     ./yp
16K     ./lock
9.7M    ./spool
365M    ./log
4.0K    ./local
4.0K    ./opt
107M    ./www
4.0K    ./nis
4.0K    ./preserve
4.0K    ./account
1.1M    ./webmin
42G     ./
[root@* var]# cd /lib
[root@* lib]# du -h -x --max-depth=1 ./
22M     ./firmware
8.0K    ./lsb
20K     ./crda
44K     ./alsa
52K     ./terminfo
94M     ./modules
2.9M    ./kbd
4.0K    ./security
1.2M    ./udev
120M    ./

I did not find what takes space
 
That must be a process which keeps writing to /var/lib/ (badly rotated logs?)
You might need to use

Code:
lsof | grep /var/lib

to find the process and restart it. Install lsof from a repo if you are missing it.
 
Apparently it logs of MYSQL
Log in to phpMyAdmin with Creating user da_admin
I clicked on Binary log
And listed up there

Select binary log to view 58 Files, 41 289 MiB
How do I clean it without causing any damage?
 
Delete binary logs of mysql it is not needed unless you do replication.

Make sure you comment out log-bin in /etc/my.cnf too
 
Code:
[root@* mysql]# du -sm * | sort -nr
1025    mysql-bin.000056
1025    mysql-bin.000055
1025    mysql-bin.000053
1025    mysql-bin.000052
1025    mysql-bin.000051
1025    mysql-bin.000050
1025    mysql-bin.000049
1025    mysql-bin.000048
1025    mysql-bin.000047
1025    mysql-bin.000046
1025    mysql-bin.000045
1025    mysql-bin.000044
1025    mysql-bin.000043
1025    mysql-bin.000042
1025    mysql-bin.000041
1025    mysql-bin.000040
1025    mysql-bin.000039
1025    mysql-bin.000038
1025    mysql-bin.000037
1025    mysql-bin.000036
1025    mysql-bin.000035
1025    mysql-bin.000033
1025    mysql-bin.000032
1025    mysql-bin.000031
1025    mysql-bin.000030
1025    mysql-bin.000029
1025    mysql-bin.000028
1025    mysql-bin.000027
1025    mysql-bin.000026
1025    mysql-bin.000025
1025    mysql-bin.000024
1025    mysql-bin.000023
1025    mysql-bin.000022
1025    mysql-bin.000021
1025    mysql-bin.000019
1025    mysql-bin.000016
1025    mysql-bin.000013
1012    mysql-bin.000017
831     mysql-bin.000057
463     mysql-bin.000020
409     ********
315     mysql-bin.000018
307     mysql-bin.000014
192     mysql-bin.000006
166     ********
123     ********
113     mysql-bin.000058
111     mysql-bin.000054
75      ********
58      ********
52      ********
46      mysql-bin.000034
20      ********
13      ********
13      ********
11      ********
8       mysql-bin.000002
7       ********
5       ********
5       ib_logfile1
5       ib_logfile0
5       ********
4       mysql-bin.000007
4       mysql-bin.000001
4       ********
4       ********
3       ********
3       ********
2       ********
2       ********
2       ********
2       mysql-bin.000010
2       mysql
2       ********
2       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       RPM_UPGRADE_MARKER-LAST
1       RPM_UPGRADE_HISTORY
1       ********
1       ********
1       ********
1       mysql-bin.index
1       mysql-bin.000015
1       mysql-bin.000012
1       mysql-bin.000011
1       mysql-bin.000009
1       mysql-bin.000008
1       mysql-bin.000005
1       mysql-bin.000004
1       mysql-bin.000003
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
1       ********
0       mysql.sock
 
disable binary logging in /etc/my.cnf, restart mysql then run:

Code:
find /var/lib -name mysql-bin.\* -delete
 
disable binary logging in /etc/my.cnf, restart mysql then run:

Code:
find /var/lib -name mysql-bin.\* -delete


I need to remove these lines that my.cnf file?
Code:
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed
 
Just put a # infront of them then restart mysql

The log-bin line is the only one that really matters.
 
Code:
Filesystem 	Size 	Used 	Avail 	Use% 	Mounted on
/dev/mapper/vg_*-lv_home	337G	72G	248G	23%	/home
/dev/mapper/vg_*-lv_root	50G	4.1G	43G	9%	/
/dev/sda1	485M	36M	424M	8%	/boot
tmpfs	2.9G	0	2.9G	0%	/dev/shm

Thank you very much helped me :cool:
 
Just to add another note; in an emergency when you need to quickly reclaim space on /var you can remove archived log files:
Code:
# cd /var/log
# rm -f *.?
This should remove only archive log files.

Warning: I don't guarantee anything unless I'm doing it for you under contract. If you want to see what will be deleted first, then do this first:
Code:
# cd /var/log
# ls -al *.?
This will show you what the above command will delete. don't use -f if you want to be asked before deleting all the files, just to be sure.

Jeff
 
Back
Top