Find the answer to your Linux question:
Results 1 to 5 of 5
my /var directory is very small, and it keeps filling up. My /opt directory has over 1 GB free, is there a way that I can make files write to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    87

    redirect /var writes to different directory?


    my /var directory is very small, and it keeps filling up. My /opt directory has over 1 GB free, is there a way that I can make files write to /opt instead of /var?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,380
    Sure. Copy /var to /opt/var, then create a symbolic link from /opt/var to /var. You will need to boot to a live/rescue image first because the OS has files open in /var, such as /var/log/messages, etc. This is not uncommon when /var is just a mount point for a small partition. Myself, I don't like to do it that way, and since default installations of RedHat Linux systems these days just make /var a directory and not a mount point under /, I have to think your system has been around awhile? What distribution+version is it?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jan 2011
    Posts
    87
    thanks for the reply. This is a custom build CentOS 5.4 that I inherited.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,380
    Yes, some folks think they know better than the operating system developers... /var is used for a LOT of cruft that HAS to be available when the system runs, such as /var/log, etc. Log files grow, and sometimes quickly. You might try to clean up the log files of older data that you will never need...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined! nelop's Avatar
    Join Date
    Feb 2012
    Location
    Bakewell Derbyshire
    Posts
    8
    I think it might be better to consider a rebuild , if you only have 1GB spare in opt and you move /var over and it continues to grow your going to end up in a pickle.

    normally when I take any box on I schedule in a rebuild just to be on the safe side. It also gives me a chance to put a runbook together so if the box ever goes wrong at 3am its less of a pain.

Posting Permissions

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