Results 1 to 3 of 3
I've run into a problem with a remotely hosted server.
On it, there has been a /var partition configured of 510MB.
My plan is to create a /var directory on ...
- 12-10-2007 #1Linux Enthusiast
- Join Date
- Oct 2004
- Posts
- 609
Problem with /var
I've run into a problem with a remotely hosted server.
On it, there has been a /var partition configured of 510MB.
My plan is to create a /var directory on / (where there is enough space) and change the current /var partition into /var/log. But I have only root access through SSH.
Any good ideas how to make this happen without me needing to go there?
- 12-10-2007 #2
Here's a hypothetical (but untested) idea. Caveat emptor.
- Create the new directory - /var-new.
- Kill all daemons you can think of that'd be writing to /var. (This includes syslogd, sendmail, and anything that relies on a lock file, which is just about everything. You'll need to leave sshd running obviously.)
- Carefully copy /var/* to /var-new, preserving timestamps and permissions.
- Take a backup of your /etc/fstab, and then remove the entry that mounts /var to a separate filesystem. Since you're creating /var-new under /, you should not need any /var entry going forward.
- Here's where things get tricky; rename /var to /var-old (may have to force it, which may get ugly).
- Rename /var-new to /var.
- Reboot.
If the box will not allow the /var renaming to occur on a multiuser runlevel, you may need to do this in single-user mode.
- 12-11-2007 #3Linux Enthusiast
- Join Date
- Oct 2004
- Posts
- 609
Thanks for the thoughts. I will give it a try (although I doubt renaming /var will work because ssh also has a process running).


Reply With Quote