Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Feb 2011
Linux OSCent dev sda5 running out of space
This is my first time as a member but I have spent a lot of time looking at the ports.
My server is running OSCent.
I had a problem with my server where the dev/sda5 partition was running out of space. After a lot of searching around for a solution I thought it only right I should share my findings.
I found the cause to be the MySQL binary log files were getting very big, in some cases over 1Gb. The solution to this issue was to find a way of removing them but there was not a lot of information on how this was done. So this is what I did.
In the var/mysql directory I found files like:
All for these files were over 1Gb.
To remove them I found an artical which discribed how to use "Purge binary logs".
Login to your server at the command prompt.
From the command prompt login to MySQL:
Command> mysql -u admin -p
Enter your password
This account must have "super privilgies".
To purge the "Binary logs"
Command> purge binary logs <followed by the name of the log file >
Command: purge binary logs before <followed by a date >
Example: purge binary logs before '2011-02-14 07:30:00';
This will remove all the binary log file before the given date and time.
I also found that from the command prompt I could enter a command that would automatically remove the binary logs.
Command> expire_logs_days=n; < n is the number of days you wish to keep your binary log files.
The command format for this is:
Command-Line Format --expire_logs_days=#
Option-File Format expire_logs_days
Option Sets Variable Yes, expire_logs_days
Variable Name expire_logs_days
Variable Scope Global
Dynamic Variable Yes
I do hope someone finds this helpful, I know I did.
- Join Date
- May 2006
That is why when I'm setting up a heavily used server I always either install apps like MySQL and or Apache to their own partitions or put /usr and or /var on it's own partition. I also often use LVM partitions as well. I've had more than one server run completely out of disk space on / because of Apache, Postgres or MySQL logs. I've also had xsessionerrors files fill up / one of many reasons I put /home on it's own partition.