Results 1 to 9 of 9

Thread: /var FULL!!

  1. #1
    Join Date
    Nov 2001
    Location
    Toronto, Canada
    Posts
    111

    /var FULL!!

    Hello,
    I just logged into my server and I found the /var is %100 full and the mysql directoy taking most of the /var space...
    my question here how can I move the mysql directoy to the /home partition.. can you provide me the steps in doing this because its the first time I'm doing this..
    Thanks for your help,

  2. #2
    Join Date
    Nov 2001
    Posts
    852
    I dont know if this will work, but shutdown mysql, then do a backup of your mysql directory where your databases are

    usually

    /var/mysql/lib/

    Could be anything, wherever your databases are actually stored, i am assuming their are inside the lib folder as indicated above

    anyways

    move it to something like /home/mysql/databases

    Then do

    ln -s /home/mysql/databases /var/mysql/lib/

    Then try to restart mysql, if it worked, i guess you will know, if it doesnt then just move them back

  3. #3
    Join Date
    Apr 2001
    Location
    Paradise
    Posts
    11,868
    Check if you have logs in /var/log

    And check if they are too many file.1, file.2 file.3, etc

    You can remove those files safelly.

    Also, you can move your Mysql files to another partition and make a symbolic link
    Shared Web Hosting - Reseller Hosting - Semi-Dedicated Servers - SolusVM/XEN VPS
    LiteSpeed Powered - R1Soft Continuous Data Protection - 24/7 Chat/Email/Helpdesk Support
    Cpanel/WHM - Softaculous - R1soft Backup - Litespeed - Cloudlinux -Site Builder- SSH support - Account Migration
    DowntownHost LLC - In Business since 2001- West/Center/East USA - Netherlands - Singapore

  4. #4
    Join Date
    Oct 2002
    Posts
    250
    This almost happend to me because I had transaction logging on, and NEVER did anything with the log. Big mistake. If you are logging every transaction (for recovery) and don't do something with the log, it will in time eat your /home dir as well.

    Bob

  5. #5
    Join Date
    Feb 2002
    Posts
    956
    Steps to freeing space in /var:

    1. Type this:
    rm -rf /var/log/*
    2. Enjoy the space!
    This forum officially ****ing sucks

  6. #6
    Join Date
    Aug 2002
    Posts
    95
    Originally posted by roly
    Steps to freeing space in /var:

    1. Type this:
    rm -rf /var/log/*
    2. Enjoy the space!
    forgot

    /etc/rc.d/init.d/syslog restart

  7. #7
    Join Date
    Sep 2002
    Location
    Mansfield
    Posts
    314
    A few things -
    ln -s /home/mysql/databases /var/mysql/lib/ won't work because they both exist.

    rm -rf /var/log/* is a really bad idea.

    Cleaning up the transaction logs i sthe best one I saw. Back them up to somewhere and clear them out.

    Adding them to syslog may not be a bad idea for rotation, either.

    run find /var -size +10000000c
    | sort -rn | head -20

    That will give the 20 largest files in /var
    GUI admin tools have no honor. It is a good day to vi.

  8. #8
    Join Date
    Apr 2002
    Location
    Cornfield
    Posts
    131
    If your mySQL installation drops database files in /var/lib/mysql, just stop your mysql server:
    /etc/init.d/mysql stop
    Move the directory to another partition:
    mv /var/lib/mysql /home
    link it back:
    ln -s /home/mysql /var/lib/mysql
    And restart mySQL to make sure nothing broke:
    /etc/init.d/mysql start
    Fire extinguisher extraordinare
    -------------------------------
    FastServers.Net NOC Admin

  9. #9
    Join Date
    Nov 2001
    Location
    Toronto, Canada
    Posts
    111
    Thanks all for your help,
    There was not any thing in the /var/log directory, the problem was from the mysql directory so I moved it to the home and made a link to it from /var, and everything now is working fine, thats all done with your help, the /var was on its own partition 1.5GB and the mysql direstory uses 60% of it.
    now its fixed and thanks again for your help,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •