The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

changing size of directory ??

Discussion in 'General Discussion' started by basic, Feb 12, 2006.

  1. basic

    basic Active Member

    Joined:
    Nov 10, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Hello All:

    I made the /var directory too small.
    Is there any way to change the size of a directory under Linux without reformating the HDD ?

    John
     
  2. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    You cannot resize the Linux partition once created. Only LVM partitions can be resized.
     
  3. HostMerit

    HostMerit Well-Known Member

    Joined:
    Oct 24, 2004
    Messages:
    160
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New Jersey, USA
    cPanel Access Level:
    DataCenter Provider
    If you cannot reformat easily, I'd suggest symlinking folders. Aka add a second hard drive as /home2, then say, move /var/lib to /home2 like this. (assuming you have /home2 as a 2nd hard drive)

    cd /var;cp -Rp lib /home2;mv lib lib.bak;ln -s /home2/lib;

    That should sucessfully move /var/lib to /home2/lib, then create a virtual link, so /var/lib is correctly working, and its files are at /var/lib.bak/ Restart mysql, and should be okay, at which point you can move / trash the lib.bak directory (Keeping a backup is always suggested)

    This is a hack job way of doing it, but sometimes it's the only option.
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yup. Also, if you obtain an additional disk you can always create a larger /var partition on that and copy the contents from one to the other and then dismount the old one and use it for something else. I'd go with HostMerit's suggestion.
     
Loading...

Share This Page