matfish Posted October 21, 2008 Share Posted October 21, 2008 Hi there, bit of a "systems maintenance" newbie. I have a server, running a big database, with lots of little mico-sites showing the disk space usage below: Filesystem Size Used Avail Use% Mounted on /dev/md1 989M 412M 526M 44% / /dev/md5 4.9G 4.1G 898M 83% /usr /dev/md7 100G 50G 50G 51% /var /dev/md6 4.9G 126M 4.8G 3% /home none 997M 36K 997M 1% /tmp I don't really know what is used where, but /dev/md5 lately is on the rise - is this where the database is stored? Will it all come to a stop when /dev/md5 is full? Many thanks Quote Link to comment Share on other sites More sharing options...
rhodesa Posted October 21, 2008 Share Posted October 21, 2008 check out http://www.linux.com/articles/51600 Quote Link to comment Share on other sites More sharing options...
trq Posted October 21, 2008 Share Posted October 21, 2008 Your database (mysql) should be under /var somewhere if your system follows the standards. Most software is stored under /usr though, what the hell have you got on this machine? Quote Link to comment Share on other sites More sharing options...
matfish Posted October 21, 2008 Author Share Posted October 21, 2008 Thanks for the replies. The server is purchased as a dedicated server with a hosting company, therefore I can only access via Plesk and SSH. Its only use is the main website and several smaller micro sites. As I said, the database is huge and collects a lot of customer details, registration forms and statistics using PHP and MySQL 5. Apart from the websites and database, I have no idea what else could be happening on here.. Where would access logs be stored? Since my first post, /usr has used another 8M. I really don't want to come to the point where it displays "Run out of disk space" across the sites and not knowing what to delete? Any help would be appreciated. Many thanks Quote Link to comment Share on other sites More sharing options...
trq Posted October 21, 2008 Share Posted October 21, 2008 Where would access logs be stored? All variable data (eg; databases, websites & logs) should be under /var This will find files larger than 50mg under /usr and print them for you. Might help. find /usr -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' Quote Link to comment Share on other sites More sharing options...
rhodesa Posted October 21, 2008 Share Posted October 21, 2008 you can also try a similar find command for files modified within the last 30 minutes: find /usr -type f -mmin -30 -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' easy way to solve this is to call your hosting company and complain. this is the kind of stuff you are paying them for. Quote Link to comment Share on other sites More sharing options...
matfish Posted October 21, 2008 Author Share Posted October 21, 2008 Hi Thorpe, This shows: /usr/local/psa/var/lib/webalizer/webalizer.cache: 80M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/clicktracker.MYD: 68M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000001: 93M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000003: 386M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000004: 185M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000005: 182M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000008: 101M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000012: 137M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000014: 529M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000015: 102M /usr/lib/locale/locale-archive: 51M What are they related too? Many thanks for your help! Quote Link to comment Share on other sites More sharing options...
matfish Posted October 21, 2008 Author Share Posted October 21, 2008 Hi rhodesa, The hosting company will not help me as it was purchased as a dedicated server and should be maintained by myself. They will not even let us purchase more disk space unless we move everything to a completely new server - which I really do not want to do at the moment. Many thanks Quote Link to comment Share on other sites More sharing options...
matfish Posted October 21, 2008 Author Share Posted October 21, 2008 Last files modified: /usr/local/psa/admin/logs/ssl_log: 858K /usr/local/psa/admin/logs/httpsd_access_log: 1.3M /usr/local/psa/admin/logs/ssl_cache.pag: 8.0K /usr/local/psa/admin/sessions/sess_079e5b5c34da2d09e06b7be3c6a65aa1: 1.2K /usr/local/psa/var/log/maillog: 777K /usr/local/psa/var/lock/files/336d5ebc5436534e61d16e63ddfca327: 0 /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table1].MYI: 212K /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table2].MYD: 35M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table3]p.MYD: 1.3M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table4].MYD: 15M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table5].MYD: 68M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table6].MYD: 1.4M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table7].MYD: 1.3M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table8].MYI: 22M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table9].MYI: 2.4M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table10].MYD: 9.7M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table11].MYI: 6.0M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table12].MYI: 347K /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table13].MYI:1.4M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table14].MYD:15M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table15].MYI: 697K /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table16].MYI: 892K /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table17].MYD: 11M /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table18].MYI: 571K /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table19].MYD: 46K /usr/local/mysql-standard-5.0.22-linux-i686/data/[DB-name]/[table20].MYD: 2.4M /usr/local/mysql-standard-5.0.22-linux-i686/data/mysql-bin.000015: 102M Seems they are the tables in the database? Many thanks Quote Link to comment Share on other sites More sharing options...
rhodesa Posted October 21, 2008 Share Posted October 21, 2008 looking around google, those mysql-bin.* files are mysql log files...and you can read/manage them with this: http://dev.mysql.com/doc/refman/5.0/en/mysqlbinlog.html Quote Link to comment Share on other sites More sharing options...
trq Posted October 21, 2008 Share Posted October 21, 2008 They may be logs. Silly place to put them considering /var is 100G and thats where this data should be. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted October 21, 2008 Share Posted October 21, 2008 you can try moving the data dir...just be careful. http://lists.mysql.com/mysql/128959 Quote Link to comment Share on other sites More sharing options...
matfish Posted October 21, 2008 Author Share Posted October 21, 2008 Hi, Many thanks for everyones help - Seem to be getting somewhere now. I found: -rw-rw---- 1 mysql5 mysql5 93M May 20 09:59 mysql-bin.000001 -rw-rw---- 1 mysql5 mysql5 18M May 22 08:40 mysql-bin.000002 -rw-rw---- 1 mysql5 mysql5 386M Jul 3 09:15 mysql-bin.000003 -rw-rw---- 1 mysql5 mysql5 185M Jul 21 11:45 mysql-bin.000004 -rw-rw---- 1 mysql5 mysql5 182M Aug 8 08:45 mysql-bin.000005 -rw-rw---- 1 mysql5 mysql5 3.6M Aug 8 12:46 mysql-bin.000006 -rw-rw---- 1 mysql5 mysql5 117 Aug 8 13:49 mysql-bin.000007 -rw-rw---- 1 mysql5 mysql5 101M Aug 18 10:18 mysql-bin.000008 -rw-rw---- 1 mysql5 mysql5 974K Aug 18 11:58 mysql-bin.000009 -rw-rw---- 1 mysql5 mysql5 4.6M Aug 18 17:17 mysql-bin.000010 -rw-rw---- 1 mysql5 mysql5 19M Aug 20 11:30 mysql-bin.000011 -rw-rw---- 1 mysql5 mysql5 137M Sep 1 10:20 mysql-bin.000012 -rw-rw---- 1 mysql5 mysql5 26M Sep 3 10:08 mysql-bin.000013 -rw-rw---- 1 mysql5 mysql5 529M Oct 14 23:44 mysql-bin.000014 -rw-rw---- 1 mysql5 mysql5 103M Oct 21 16:22 mysql-bin.000015 Which are the logs you refer too. I'm not that advanced to be moving the data folder to a new location. Can these files be deleted or the contents deleted or what do these files actually do and store? Thanks again Quote Link to comment Share on other sites More sharing options...
matfish Posted October 21, 2008 Author Share Posted October 21, 2008 I tailed one of the files which was a big mistake, however found it is storing all the query's made on the databases. Its stored all the inserts, updates etc... Just wondering what would happen if they got deleted?! Would it just start again? Thanks Quote Link to comment Share on other sites More sharing options...
trq Posted October 21, 2008 Share Posted October 21, 2008 I tailed one of the files which was a big mistake Did you even read the link rhodesa sent you? They are log files stored in binary form. You need to use the tools provided to read them. They are simply log files. They store logs of events that are perfomed on your database. If your not interested in looking at them, they are safe to remove. Quote Link to comment Share on other sites More sharing options...
matfish Posted October 21, 2008 Author Share Posted October 21, 2008 Hi thorpe, Yes I read the link, as I mentioned - I'm a newbie I guess and just went back to basics to tail the last 10 lines, It only through a wobbley on the server for a bit then server loads came back down anyhoo. I'm going to just move them all for now onto some reserved space and see what happens. I can always put them back if things go tits up. Hours of googling didnt give me the answers you have helped me with. Thanking you all for your help. Quote Link to comment Share on other sites More sharing options...
corbin Posted October 22, 2008 Share Posted October 22, 2008 Why not just move your MySQL related data to /var, like some people have already suggested. You're entirely wasting 50GB. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted October 22, 2008 Share Posted October 22, 2008 another way I saw on how to move the data dir (instead of editing the datadir value in my.cnf) is to move the directory and then make a symbolic link to the new place. mysql shouldn't know the difference. Quote Link to comment Share on other sites More sharing options...
corbin Posted October 22, 2008 Share Posted October 22, 2008 I've moved my data dir a couple different times, and I've never had problems. Are there some problems that are common that I've just never run into? Or what's so difficult about it? Quote Link to comment Share on other sites More sharing options...
trq Posted October 22, 2008 Share Posted October 22, 2008 There shouldn't be (and isn't) anything difficult about it. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted October 22, 2008 Share Posted October 22, 2008 i don't think it's anything difficult...i just recommend not mucking around in there when you are a super-novice, over-tired, etc as there is a chance you accidentally delete something Quote Link to comment Share on other sites More sharing options...
corbin Posted October 22, 2008 Share Posted October 22, 2008 Ahhh yeah.... Nothing like deleting something then going "OH SHIT!!!!!" Quote Link to comment Share on other sites More sharing options...
CroNiX Posted October 22, 2008 Share Posted October 22, 2008 If you are not interested in this data, couldn't you just turn the feature off and delete them? Quote Link to comment Share on other sites More sharing options...
steviewdr Posted October 24, 2008 Share Posted October 24, 2008 mysql-bin logs are typically for replication of a mysql server. These mysql-bin logs and their flushing/expiry can be set in my.cnf. -steve Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.