Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Is there a way to add space to a partition?

Discussion in 'General Discussion' started by noimad1, Jun 12, 2007.

  1. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    166
    Please forgive my ignorance in this question, i know already I probably am going to sound like a retard for asking it.

    HOwever, is there a way to add space to an existing partition without losing all of the files?

    For example, i ordered a server, and the datacenter only put a 6GB partiion on my /var/. Now, i have like 5gb worth of databases in /var/lib/mysql and the partition is full.

    If not, what are my options here?

    Could I move all of the databases to another location and create a sym-link for msyql directory to point there? Or is there a better option?
     
  2. vwiley1

    vwiley1 Well-Known Member

    Joined:
    Oct 4, 2003
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    156
    I moved mine to /home/mysql and have a symlink from /var/lib/mysql.
     
  3. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    166

    I tried that, but then I had a problem with the mysql.sock file for some reason. I would create the file, then restart mysql and it would be gone, and mysql wouldn't start?

    Did you have to do anything special for that?
     
  4. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,051
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Earth
    Hi,

    Specify the path to mysql.sock file in /etc/my.cnf file and restart mysql. Below is the entry for example:

    socket = /var/lib/mysql/mysql.sock

    This should fix the problem for you.

    Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. TechBrein

    TechBrein Member

    Joined:
    Jul 31, 2006
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    noimad1,

    Remove the unwanted files, if any, from /var first. You may safely remove the mysql binary logs inside /var/lib/mysql. They usually consume very large space. Moving /var/lib/mysql to another location and creating a symlink to /var/lib/ should work. How did you move the mysql databases? Did you create a directory, say in /home, and then moved the dirs under /var/lib/mysql over there? If so, make sure that the directory that contains the mysql DBs has got the permission of 751 and the ownership of mysql:mysql.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    166

    Yes, I did create a folder under the home directory, set the permissions to 751 and the ownership to mysql:mysql. I then created the symlink, and the mysql.sock file just kept disapearing each time I would restart mysql.

    Now here is the scary part. I move all of the files back (just using the mv command) and all uf a sudden my mysql folder went from 4.0GB to 1.2gb.....i don't know what is missing, and it makes me very nervous. I didn't delete anything, just 'mv' it. I haven't had any customer say their databases are gone or anything like that......

    Anyone ever seen that happen?
     
  7. TechBrein

    TechBrein Member

    Joined:
    Jul 31, 2006
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    Did you remove any files, mysql binary logs, in particular?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #7 TechBrein, Jun 14, 2007
    Last edited: Jun 14, 2007
  8. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    166
    No, that's what has me kind of freaked out. I didn't remvoe anything, just used the "mv command"
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice