System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

var cleanup hp ux 11.23 itanium

SOLVED
Go to solution
Donald Thaler
Super Advisor

var cleanup hp ux 11.23 itanium

i'm looking at cleaning up the /var directory, it's 80% full.. in the /var/adm/sw/save/ directory are what look like Patch directories like \PHSS_38140.. can these directories be removed ?


14 REPLIES
Michael Steele_2
Honored Contributor
Solution

Re: var cleanup hp ux 11.23 itanium

Hi

If you are fairly new to HP-UX then refer to the 'Routine Tasks' section under SAM and let SAM guide you in this task.
Support Fatherhood - Stop Family Law
James R. Ferguson
Acclaimed Contributor

Re: var cleanup hp ux 11.23 itanium

Hi Donald:

Do _not_ manually diddle (remove, modify, etc.) in the '/var/adm/sw' directory. If you corrupt the contents of this directory you can render your server un-patchable.

To potentially regain space, use the 'cleanup' command:

# cleanup -c 1

Regards!

...JRF...
Fabian Briseño
Esteemed Contributor

Re: var cleanup hp ux 11.23 itanium

Hello Donald.
Do not delete manually any file in /var/adm/sw you can corrupt your software.

check under /var/tmp to see if you can delete something there.

also check /var/tombstones

Another option should be to search for core file in var.

Knowledge is power.
Vishu
Trusted Contributor

Re: var cleanup hp ux 11.23 itanium

Hi Donald,

Dont delete anything in /var/adm/sw/save directory. It is used for rollback.

Better look for some old pacct files in /var/adm or you can truncate some of your logs like /var/adm/cron/log, or anything in /var/tmp.
Donald Thaler
Super Advisor

Re: var cleanup hp ux 11.23 itanium

I was trying to free up space on /var because when i ran swa(software ass't), it indicated i didn't have enough free space. Is there some way of running swa and telling it to use some other mount point ?
James R. Ferguson
Acclaimed Contributor

Re: var cleanup hp ux 11.23 itanium

Hi (again) Donald:

In '/root/.swa.conf' (or on the command line) you can set the '-x user_dir' and the '-x swcache' to a directory that offers you the space you need.

See:

http://docs.hp.com/en/5992-5125/5992-5125.pdf

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: var cleanup hp ux 11.23 itanium

> I was trying to free up space on /var because when i ran swa(software ass't), it indicated i didn't have enough free space. Is there some way of running swa and telling it to use some other mount point ?

The best thing to do is to create another lvol that will hold the /var/adm/sw directory. Once the lvol is created, mount it to a temporary mountpoint, copy all the files and directories to the new location. As a precaution, backup the /var/ad/sw directory to tape or another location. Then unmount the new lvol, remove all the files and directories in /var/adm/sw and mount the new lvol to /var/adm/sw. The last step is to add the new mountpoint to /etc/fstab.

You should also analyze /var using du to see what other large directories are present. Use this command:

du -sk | sort -rn | head -20


Bill Hassell, sysadmin
Michael Steele_2
Honored Contributor

Re: var cleanup hp ux 11.23 itanium

Hi

# swa clean {usercache | swcache | all}
When the swa command runs, it produces cache files for its use. Run swa clean to free up disk
space after your swa session is complete.

See attached.
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: var cleanup hp ux 11.23 itanium

Hi

In answer to your question, use the -x user_dir option.

x user_dir=~/.swa
Usage: Basic
Applicable caches: usercache all
This is the directory where SWA stores catalog, inventory, analysis, ignore, and report files.
The default location is a subdirectory (.swa) of the user's home directory. This can be changed,
for example, to allow archival of previous interim artifacts in a date-specific directory or
off-host. Several other options default to a directory relative to this directory, so changing
this option allows all of those locations to stay in synch relative to a common root.
Support Fatherhood - Stop Family Law
Donald Thaler
Super Advisor

Re: var cleanup hp ux 11.23 itanium

the command du -sk | sort -rn | head -20
just returns a number ??

# du -sk | sort -rn | head -20

2678160 .
James R. Ferguson
Acclaimed Contributor

Re: var cleanup hp ux 11.23 itanium

Hi Donald:

> The command du -sk | sort -rn | head -20
just returns a number ??

Drop the 's' which summarizes and use:

# du -k /var|sort -krn|head -20

Regards!

...JRF...
grshankar
Frequent Advisor

Re: var cleanup hp ux 11.23 itanium

Hi,



Some Pionts to clean up /var Spaceâ ¦

1. Release space from /var:
- remove core dump:
# find /var -name core -exec rm {} \;
2. cleanup old patches
cleanup -c 2
3. The following file in /var/stm/logs/os (Keep latest.)
memlog
logN.taw.cur
ccbootlog
Bill Hassell
Honored Contributor

Re: var cleanup hp ux 11.23 itanium

Sorry about the typo -- the actual du option should be:

du -xk /var | sort -rn | head -20

(s is just too close to the x key)

Just to explain the use of du and not find for large files: Until you examine every directory in /var, looking for large files will miss a directory with thousands of small files. The du command summarizes directories. Once you find an unusually large directory, look inside to find the contents. You can sort the contents by size:

cd /var/someLargeDirectory
ll | sort -rnk5 | head -20


Bill Hassell, sysadmin
Bob E Campbell
Honored Contributor

Re: var cleanup hp ux 11.23 itanium

Nice to know that SWA is covered when we turn away for a bit, thanks guys!

I might also throw out that often the mass of the QPK bundle can be an issue. If you already have that on media then preload it into your depot and then use:

# swa get -t /depotHere -x allow_existing_depot=true

While I am a big fan of the QPK bundle you could also use just the SEC, PW, and CRIT analyzers.