Two partitions getting full

Posted on 2009-02-10
Medium Priority
Last Modified: 2013-12-06
I have a web/db server with 4 drives on raid10.

The /usr and /var partitions are getting full.

Should I move /var and /usr to /home and symlink back to them or is that not recommended.

What do you recommend based on best practices.

Filesystem          1K-blocks             Used             Available    Use%     Mounted on

/dev/sda5            8123168          644292            7059584        9%     /
/dev/sda8        247004276      13293172        220961520        6%     /home
/dev/sda6            1019208          420536              546064      44%     /tmp
/dev/sda3            8123200        6292376            1411528      82%     /usr
/dev/sda2          10154020        6997620            2632280      73%     /var
/dev/sda1              124427            22440                95563      20%     /boot
tmpfs                   2021744                    0            2021744        0%     /dev/shm

Operating System: CentOS 5 (64-bit)
Processor: 4 x Quad Core - Intel Xeon E5335
Hard drive: 4 x 15K rpm SAS 147 GB
Question by:ray-solomon
  • 2
  • 2
LVL 48

Accepted Solution

Tintin earned 2000 total points
ID: 23606974
/usr should be an almost static filesystem, so not much need for worry there.

/var is generally your most active filesystem as that's where all the logs/mail etc are written to.

Ideally, you should resize your /home and /var filesystems, but if you don't want to go through that process, you could move some of the stuff out of /var into /home and create a symlink.

LVL 10

Author Comment

ID: 23607077
Would you please see my commands below and make sure I did not miss anything?

I am first going to do this on my testing server of course.

cp /var /home

cp /usr /home

mv /var /var/old_var

mv /usr /usr/old_usr

cd /var

ln -s  /home/var /var

cd /usr

ln -s  /home/usr /usr

And then when I think everything is working fine, I could delete (rm -rf) /var/old_var and /usr/old_usr
LVL 10

Author Comment

ID: 23607200
I modified it, and think this is a better way

cp -r /var /home
cp -r /usr /home

mkdir /var/old_var
mkdir /usr/old_usr

mv /var/* /var/old_var
mv /usr/* /usr/old_usr

cd /var
ln -s  /home/var /var

cd /usr
ln -s  /home/usr /usr
LVL 48

Expert Comment

ID: 23607319
I really wouldn't recommend playing around with /usr as you get into trouble when you start trying to move things around.

As for /var, you should ideally move things in single user mode to reduce the number of processes writing to files.

What I would recommend is moving your largest directory under /var (eg: /var/log) to /home and do

mkdir /home/var
mv /var/log /home/var
ln -s /home/var/log /var/log
/etc/init.d/syslog restart
/etc/init.d/cron restart
/etc/init.d/xinetd restart


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question