Operating System - HP-UX
1833752 Members
2802 Online
110063 Solutions
New Discussion

Re: /var volume disk space is insufficient

 
Crimson
New Member

/var volume disk space is insufficient

Hi all,

I am using HP-UX 11.00. After installing some software, I found /var volume free space is becoming too small. I also found that the /var/adm/sw/save occupies most of the space. Can I simply "rm -rf /var/adm/sw/save" or what to do to have more free space of /var?
4 REPLIES 4
Denver Osborn
Honored Contributor

Re: /var volume disk space is insufficient

Have a look at the cleanup command. This can be used to commit patches and could free space in /var. 'cleanup -c x' would cleaup patches superseded x number of times.

Before you commit any patches it wouldn't be a bad idea to have a backup or make_recovery tape. You could also look in /var/adm/crash for any system dumps. If log files have grown out of hand trim them. Easy way for you to do this would be from sam. Open SAM -> Routine Tasks -> Log Files.

Also search the forums for /var and full. I'm sure you'll find plenty of suggestions on how to find files and free up space.

Hope this helps,
-denver
Philip Chan_1
Respected Contributor

Re: /var volume disk space is insufficient

It would be bad practice to do 'rm' on /var/adm/sw/save, this will invalidate your software patching history and could cause you trouble when installing new software or performing software rollback.

Reason that the save dir took up so much space is because there are uncommited patch sets in your system after its upgrade/update. To free up the space you'll have to commit the patches,

swmodify -x patch_commit=true \*

The above command should commit all patches hence free up the space for you.

Rgds,
Philip

Bill Hassell
Honored Contributor

Re: /var volume disk space is insufficient

Adding a bit more emphasis to the recomendations: DON'T REMOVE /var/adm/sw! You will never be able load software or patches again!

/var is the most important directory after / and is also the one which changes the most. /var might need 1Gb of space or it might need 200Gb of space...it all depends on your environment. But I would not recommend using a single /var filesystem...too many unrelated subsystems can clobber the entire opsystem. Rather, setup additional /var components as separate filesystems. That way, if something goes awry and fills a filesystem, only that component goes down.

For instance, a bad mail message with 500 megs of data or a user that prints a 20 meg file 10 times in a row (because the printer doesn't work) will fill /var. Start by analyzing what is taking space in /var (never look for big files, always look for big directories...you might find 10,000 files that are only 10Kb each but they occupy a LOT of space). Use:

du -kx /var | sort -rn > /tmp/du.var

Now look at the resultant file: the largest directories are at the top of the list. Consider giving these a separate filesystem, perhaps on a separate disk. Here are the suggestions:

/var everything not listed below)
/var/adm (just for logfiles)
/var/adm/sw (installed software/patches)
/var/tmp (all user processes)
/var/spool (spooling)
/var/mail (email storage)
/var/opt (application storage)

Determine the need for a separate by your planned usage of the listed subsystems. Be generous if you are not sure. Computers always need more space. Create the logical volumes, size them appropriately, then mount each to a temporary location and when the applications and subsystems are idle (might need single user mode for some), copy all the data across to the temporary location using:

cd /var/old_location
find . | cpio -pudlmv /temporary_mountpoint

(Make sure you have a good backup of /var)

Now verify that the same number of directories and files were copied:

find . -type d | wc -l
find . -type f | wc -l

find /temporary_mountpoint -type d | wc -l
find /temporary_mountpoint -type f | wc -l

The should be the same. The occupied space may be larger or smaller in the destination - don't worry, this is normal.

Then remove the original directory recursively:

rm -rf /var/old_location

Then create a mountpoint and a flag file:

mkdir /var/old_location
touch /var/old_location/IamNOTmoiunted

(the flag file is a reminder that this is a mount point). Now add the entry to /etc/fstab, then umount the temporary mountpoint and mount using just the destination as in mount /old_location (this will verify the entry in fstab).

Repeat as needed for each additional filesystem.


Bill Hassell, sysadmin
Vincenzo Restuccia
Honored Contributor

Re: /var volume disk space is insufficient

find /var -size +xxx,or lvextend var.