Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast
    Join Date
    Oct 2004

    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?

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Here's a hypothetical (but untested) idea. Caveat emptor.

    1. Create the new directory - /var-new.
    2. 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.)
    3. Carefully copy /var/* to /var-new, preserving timestamps and permissions.
    4. 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.
    5. Here's where things get tricky; rename /var to /var-old (may have to force it, which may get ugly).
    6. Rename /var-new to /var.
    7. 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.

  3. #3
    Linux Enthusiast
    Join Date
    Oct 2004
    Thanks for the thoughts. I will give it a try (although I doubt renaming /var will work because ssh also has a process running).

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts