Running out of /usr space ...

Hi,
Can anyone please advise me on how can i increase /usr disk space manually.
The partition was created using manual disk spaces as per IT dept. request

As i don't have any space available on the said production system.
Therefore, i can move the /U01 FS to /U02 file system which will allow me to gain around 15GB of disk space to increase /usr file system.

As i've never done this before
I'll appreciate if anyone can suggest me the procedure on how it can be done.

following is a # df -h output for your kind review.

[root@asim ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             5.0G  707M  4.0G  15% /
tmpfs                 7.9G  112K  7.9G   1% /dev/shm
/dev/sda1             2.0G  145M  1.8G   8% /boot
/dev/sda9             2.0G  328M  1.6G  18% /home
/dev/sda10            1.2G  580M  535M  52% /opt
/dev/sda6             5.0G  139M  4.6G   3% /tmp
/dev/sda3              15G  6.0G  8.1G  43% /u01
/dev/sda7             5.0G  4.4G  318M  94% /usr
/dev/sda8             5.0G  981M  3.8G  21% /var
/dev/sdb1             109G   47G   56G  46% /u02

Thanks & Regards
Asim

Simple data juggling. First you need to find where you have space. Otherwise, you need to figure out what you can remove.

It takes space to manipulate space.

If the goal is to keep /usr where it is, then you'd have to move areas that are against it contiguously as far as disk sectors are concerned. You haven't supplied enough information to assess that.

Another approach might be to move /usr altogether to as different disk and/or partition.

Either way, you'll need to boot into some sort of rescue shell to do the work ideally.

I mean, if there's a ton of space available somewhere, you might be able to avoid that, but because there can be a good chance of error, you'll want to be able to get to a rescue shell (and test that out) before beginning the work. Just so that you don't lock yourself completely out.

Note: /usr is kind of a special case directory. It has to be there for startup scripts to run using commands like awk or sed. So, it has many files in /usr that also exist as symlinks in the /bin directory. Tinkering with /usr will often lead to disaster. What cjcox mentioned.

Why do you need more space in /usr - it should have been built with almost everything you'll need? The only possibility I can think of quickly is adding more new libraries to /usr/lib. Each of those new additions can be a symlink from /usr/lib to /somediskwithspace/lib

Thanks for the reply cjcox and jim mcnamara.

Actually , the server was initially installed by me as per the customers need
After few weeks I observed that the /usr FS is running out of space which need to be fixed ASAP.

The space was allocated using SAN
Therefore, i can assign more space if required.

The best way i thought was to take the /u01 partition off , so that I can have the 15GB of space available upon the same disk which further can be used to expand /u02 partition.

I don't remembered the procedure for doing so
I'll appreciate if anyone of you can guide me to do so.

The machine is in production mode too
Therefore, I'll appreciate if we can do it without any downtime if possible.

Regards
Asim

What's the growth rate of /usr?

RudiC,

Although the /usr folder is not growing but it was a rapid growth for the past 2 weeks the folder hasn't increased in size but i'm afraid that for any reason if it does , I'm sure I'll be in a lot of trouble. :o

So I guess there's no immediate need for action. And, I'd be very careful juggling around with partitions on a production system. Can't you pursue the way jim mcnamara proposed symlinking files or even directories to somewhere else?

Before you start juggling filesystems, perhaps verify that the data on that filesystem is where it belongs...

Check for dangling filehandles - compare the output of du -sk /usr and df -k /usr , if the du output is significantly lower, you've probably deleted a file but left a process using the handle. Use lsof (or fuser, /proc or pfiles) to locate the process that is holding the handle and restart it.

Look for the big blobs in /usr - du -sk /usr/* | sort -n will show you the largest directories in there, you can drill deeper from there as required.

Look for recently modified files - /usr should be fairly static, if something is changing frequently, maybe it doesn't belong in there. find /usr -mtime -10 will show files modified in the last 10 days.