Page 2 of 2

Re: Restoring MySQL databases...

Posted: Tue Jul 17, 2012 10:33 am
by mguthrie
You can safely truncate anything in the nagios database, as that contains status and historical information, but no configuration information. You can get an idea as to how big the database is by running:

Code: Select all

du -h /var/lib/mysql/nagios/
The two tables that can get pretty big are the logentries and the notifications tables. If you don't need all of that data for the migration then truncating them could save a lot of time and disk space.

If you just plain need more disk space, you can also try removing:
/var/spool/mail/root
and older log files under: /var/log/

Re: Restoring MySQL databases...

Posted: Tue Jul 17, 2012 11:43 am
by jbennett
mguthrie wrote:You can safely truncate anything in the nagios database, as that contains status and historical information, but no configuration information. You can get an idea as to how big the database is by running:

Code: Select all

du -h /var/lib/mysql/nagios/
I have cleared out all tables in the nagios db. When I run the above command, it only shows 660k in use. When I run it for the other tables, I don't see anything that would be taking up this much space:

nagios - 660K
nagiosql - 1.7M
mysql - 828K
test - 4.0K

Yet, /dev/mapper/os_vg-root_lv still shows all 16GB in use??

Re: Restoring MySQL databases...

Posted: Tue Jul 17, 2012 12:08 pm
by scottwilkerson
This could be logs or something. You can run the following to find all files over 50M

Code: Select all

find /var -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Re: Restoring MySQL databases...

Posted: Wed Jul 18, 2012 9:25 am
by jbennett
scottwilkerson wrote:This could be logs or something. You can run the following to find all files over 50M

Code: Select all

find /var -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Found one file that was 50M. Search again for anything over 20M, and I'm only seeing two other files.

This is a different file structure from what I've worked with in the past. Since I had to hand over the VM creation to a different group, I'm not really sure what the problem is here.

Re: Restoring MySQL databases...

Posted: Wed Jul 18, 2012 9:39 am
by mguthrie
I'm wondering if there's some out-of-control process using swap space until the disk is full. You could try firing that same find command at some different directories and see what turns up.