1837650 Members
2632 Online
110117 Solutions
New Discussion

Re: /usr directory

 
Michael Morah
Occasional Contributor

/usr directory

When i do bdf command i noticed that
my /usr directory is 95% i want to reduce it what do i do?
6 REPLIES 6
F Verschuren
Esteemed Contributor

Re: /usr directory

asuming jou can't extend???
vgdisplay -v vg00 and look if there are Free PE if there are free PE you can make the filesystem larger
if there are none:
please do a du -ks /usr/*
and see look for ting that are not used on the system...
Pete Randall
Outstanding Contributor

Re: /usr directory

The first step should be to look for things that can be cleaned out: files/directories that don't belong or have grown beyond what they should be and can be trimmed.

If you can't reclaim enough room to live comfortably, then you'll have to expand. If you're lucky enough to have Online/JFS, you can do this on the fly. If not you will need to boot into single user mode in order to unmount the file system to extend it. The third alternative is, if you have enough extra space, make a new file system (call it /newusr), copy the contents of /usr into it, /switch the mount points in /etc/fstab, and reboot.

Good luck,
Pete

Pete
Stanimir
Trusted Contributor

Re: /usr directory

You can use "lofs" to move /usr into
bigger directory.

Regards,Stan
Vicente Sanchez_3
Respected Contributor

Re: /usr directory

Another step is compress unused files. With this you maintain files and less space.

Regards, Vicente.
James R. Ferguson
Acclaimed Contributor

Re: /usr directory

HI:

In addition to the suggestions to expand the filesystem; compress files that may not be needed in it (doubtful); and remove files that were inadvertantly placed there, there is yet another possibility.

If you have a subdirectory of /usr which represents significant space you cound make that directory a symbolic link to another mountable filesystem in a different logical volume. You could also make a subdirectory its own mountpoint in its own filesystem. Thus a 'bdf' might show /usr and /usr/local as two discrete mountpoints on two discrete logical volumes.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: /usr directory

/usr can't be extended online unless you have purchased and installed the optional Advanced JFS product. You'll need to go into single user mode to extend the lvol and then run extendfs to extend the filesystem.

/usr is fairly static EXCEPT /usr/local and /usr/contrib which can grow unexpectedly when adding programs. Analyse the big directories with:

du -kx /usr | sort -rn | more

For today's HP-UX installations, /usr should be 800 to 1500 megs in size, about the same for /opt too.


Bill Hassell, sysadmin