LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-16-2010, 12:13 PM   #1
jbspain
LQ Newbie
 
Registered: Oct 2010
Posts: 12

Rep: Reputation: 0
Increasing size of /var folder or mount to another folder


Hello,

I'm installing things in a new Red Hat server and saw that the /var folder is full (100%). I need this folder to have more space or another kind of solution because this server is going to be used as a print server.

Any ideas?

Thanks in advance for your help.
Best regards
 
Old 11-16-2010, 12:23 PM   #2
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Rep: Reputation: 6
If you have LVM installed you can resize the var partition. If not you can symlink some of the files/directory in /var to a partition that has enough space.

I have done this with Networker Legato and it worked like a champ.
 
Old 11-16-2010, 12:42 PM   #3
jbspain
LQ Newbie
 
Registered: Oct 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by d072330 View Post
If you have LVM installed you can resize the var partition. If not you can symlink some of the files/directory in /var to a partition that has enough space.

I have done this with Networker Legato and it worked like a champ.
Hello, I was looking on how to use symlink and I have a doubt
If I run the following command:

Code:
ln -s /var /home/var
The info in /home/var will be "linked" to /var ,isn't it? All new files will be stored in this /var?

Thanks for your help!
 
Old 11-16-2010, 01:13 PM   #4
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Rep: Reputation: 6
Code:
The info in /home/var will be "linked" to /var ,isn't it? All new files will be stored in this /var?
Yes the files in /home/var will be linked to /var. So the files will not actually move from /var and new files will be stored in /var.

If you cannot change your configuration file to point to /home/var I would suggest you move what you want to move from /var to /home/var and remove that directory and then create symlink.

Example:

/var/test is 500 MB.

cp -rp /var/test/* /home/var/test
mv /var/test /var/test-orig
ln -s /home/var/test /var/test

then all new files will be stored in /home/var/test but you do not have to change your config file because /var/test still exists but it is symlinked to /home/var/test.

Test your application to see if it works. If it works then you can remove the /var/test directory.

rm -rf /var/test

Becareful of your commands when doing this.

Last edited by d072330; 11-16-2010 at 01:15 PM.
 
Old 11-16-2010, 01:21 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by jbspain View Post
The info in /home/var will be "linked" to /var ,isn't it? All new files will be stored in this /var?
Yes. Instead of /var being the mount point for the original file system that was mounted on the /var directory, /var will now point to /home/var and any files that are written to or read from /var or its subdirectories will actually be written to or read from /home/var or its subdirectories.

EDIT: but if you simply make /var a symlink to /home/var it will cause all sorts of breakage because the system expects to find files and directories there and will barf without them. At a minimum you will need the following (this is for Slackware so the details may be different but the idea and most of the directories will be the same):
Code:
/var
    |
    +-- /cache
    |        |
    |        +-- hald
    |
    +-- /empty
    |
    +-- /lib
    |        |
    |        +-- dbus
    |        |
    |        +-- msql
    |        |
    |        +-- nfs 
    |                |
    |                +-- v4recovery
    |
    +-- /log
    |        |
    |        +-- packages (symlink to /home/c/var/log/packages)
    |        |
    |        +-- setup
    |                |
    |                +- tmp
    |
    +-- /run
    |        |
    |        +-- dbus
    |        |
    |        +-- hald
    |
    +-- /spool
    |        |
    |        +-- mqueue
    |
    +-- /tmp
Several of those directories need specific owner, group and permissions.

The diagram is not complete; at least some NFS directories are missing.

Last edited by catkin; 11-16-2010 at 01:27 PM.
 
Old 11-17-2010, 05:33 AM   #6
jbspain
LQ Newbie
 
Registered: Oct 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by d072330 View Post
If you have LVM installed you can resize the var partition.
Hi, I finally used LVM to resize the var partition and it went ok but it only let me resize 5 GB when I have a partition of 800 GB for "/" folder. How can I assign more gigas to a certain partition using LVM?

Thanks!
 
Old 11-17-2010, 01:04 PM   #7
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Rep: Reputation: 6
Quote:
Hi, I finally used LVM to resize the var partition and it went ok but it only let me resize 5 GB when I have a partition of 800 GB for "/" folder. How can I assign more gigas to a certain partition using LVM?
If you do not have any free space then you will have to subtract some space from another partition that is oversized (i.e. you have found a particular partition that is too big).
 
Old 11-18-2010, 03:33 AM   #8
jbspain
LQ Newbie
 
Registered: Oct 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by d072330 View Post
If you do not have any free space then you will have to subtract some space from another partition that is oversized (i.e. you have found a particular partition that is too big).
Thanks, that's what I did after investigating a little of LVM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Increasing size of a folder jameeljam Linux - Newbie 2 07-28-2010 09:26 AM
Increasing size of a user folder campol76 Linux - Newbie 2 02-26-2008 08:59 AM
/var/adm/wtmp file is increasing its size...? johnsanty Linux - General 2 09-29-2006 12:05 AM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 03:09 PM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 03:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration