Help moving /var to another partition.

Sentinel

Verified User
Joined
Nov 3, 2003
Messages
23
Location
Portugal
Hello all,

I don't like to ask for help, but when it's something like this, I have to stop being stubborn and just ask!

I have had now, for a while, issues with disk space in my main partition. This is mainly due to the fact that the main partition is wayyy too small.

Filesystem Size Used Avail Use% Mounted on
/dev/hda1 2.9G 2.5G 257M 91% /
/dev/hda2 226G 44G 172G 21% /home
/dev/shm 501M 0 501M 0% /dev/sh

I have already moved mysql to the /home directory, but I'd really like to move the entire /var directory to the /home directory.

Has anyone done this successfully on CentOS? And if so, can you perhaps share the script/commands?

As you know, without disk space everything just stops working. mysql, httpd, etc, and clients just panic. I'm afraid to attempt to move the /var directory myself like I did with the mysql directory because... well, it's a pretty important directory, and I don't want to screw anything up!

So, if anyone has done this already, successfully, please share your steps?

Thanks.
 
mv /var /home/var
ln -s /home/var /var

Boot into single user mode if you can to do it so its not being written to :)
 
Don't think it is possible as the server's datacenter is located in a different country.

Won't moving it just like this cause issues? I mean, it can't be THIS easy?
 
There are server programs (daemons) out there that detect if they're running in a linked directory, and will do anything from warn you to shut down. Why? conceivably as a protection against attacks.

So best is to do some tests first.

Lots of us who came from the Cobalt RaQ world have a lot of experience with this.

You should really have your datacenter do it in single-user mode. (Note, do NOT change to single-user mode from your command line; you'll lose control of your server.)

Jeff
 
Back
Top