Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So when my host setup my dedi, they seemed to apply most of the drive space to /var

I am on cpanel, and need most of the space for the /home directory where all the accounts and data are.

But on previous dedi's ive had the majority of the drive was just assigned to /

This is what I get when I do a

    df -h


    Filesystem            Size  Used Avail Use% Mounted on
    rootfs                 20G   16G  3.7G  81% /
    /dev/root              20G   16G  3.7G  81% /
    none                   16G  404K   16G   1% /dev
    /dev/md2               92G   14G   74G  16% /var
    /dev/loop0            4.0G  139M  3.7G   4% /tmp
    /dev/loop0            4.0G  139M  3.7G   4% /var/tmp
    /dev/root              20G   16G  3.7G  81% /var/named/chroot/etc/named
    /dev/root              20G   16G  3.7G  81% /var/named/chroot/usr/lib64/bind

Not sure why its like this. Can I somehow use the 92G for / rather then /var without losing any data and things going tits up?

I am on centos 6 if that helps.

thanks

mike

share|improve this question
    
Can be done, but would require delicate juggling. Not for the faint of heart (and even less for the backup-less). –  vonbrand Feb 17 '13 at 0:27

1 Answer 1

/var is not temporary, so you can use it. You'll need to stop all access to /home for a few minutes while the data moves, since these are probably different physical partitions. Ie, stop the server! It won't take long. Also: do this as root, not via sudo. Next:

cd /
mv home home_mnt

I'm using a different and unique name in case there's a real /var/home or something. Keeps things tidy and hopefully more clear. Now:

mv home_mnt var

What was /home is now /var/home_mnt. But you are going to use it via a symlink:

ln -s /var/home_mnt /home

Presto. Try cd /home to check. "Home" is a good directory to move because it is non-essential to the base system. Don't try this with, eg, /usr -- it'll hurt, a lot.

Do not move anything into /tmp or /var/tmp either. Those will disappear.

share|improve this answer
    
Ok cool brilliant, I will give that a try. I am thinking that a lot of space will be taken up with /usr too from all the mysql data. Is there no way to just reassign the 92GB to / rather than /var ? I don't want to have to reinstall the OS and everything if I don't have to. Thanks –  Mike Meade Feb 17 '13 at 10:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.