Operating System - HP-UX
1834007 Members
1834 Online
110063 Solutions
New Discussion

Problems extending /var...

 
Shaun Aldrich_1
Advisor

Problems extending /var...

Hello Everyone,

Currently my /var filesystem is at 90%. How do I know what I can delete in this filesystem to shrink it? I would have added additional space to the logical volume as the volume group has approx 2.6 GB available but when I tried through sam to increase the size of the lvol using Online JFS I received the message 'Not enough free physical extents available'.

Anyone know what that means or how I could fix it? Any suggestions to increase / decrease this filesystem would be greatly appreciated.

S Aldrich
Hard work & dedication goes a long way...
8 REPLIES 8
Peggy Fong
Respected Contributor

Re: Problems extending /var...

Hi
There have been similar threads on the forum - search for "var full"

There are many files you can remove to cleanup /var

/var/tmp
/var/preserve
Look for large log files in /var/adm /var/cron /var/spool /var/syslog

To look for largest files
du -ax /var | sort -rn -o /tmp/var.out

review output of /tmp/var.out and see if there is anything that can be removed.

Message means not enough extents available in the volume group (make sure this lvol is not contiguous).

Peggy
Steffi Jones_1
Esteemed Contributor

Re: Problems extending /var...

Hello Shaun,

there are a few places where you can retrieve some more space.
check for example in /var/adm/crash if you find a crash directory with an older timestamp. You can probably delete these older files.
Then there are several logfiles in /var/... which can be trimmed.

If you don't have any PE's available you might want to consider adding another disk to your vg00. Sooner or later you will need the disk space anyways.

Be careful with committing patches (which would save some space) but then you can't remove the patches anymore.

Just a few ideas for now.

Steffi jones
Mark Seida
Occasional Advisor

Re: Problems extending /var...

The error not enough physical extents means that the lvm does not have the number of physical extents available that you are trying to increase the file system too. Try doing a vgdisplay -v vg00 and see how many free physical extends you have available.
Do you have any software depots on the machine you might want to relocate them to another filesystem that has more free space. You might run du -sk * in /var to see which directories are using the majority of space. You can pretty much clean out all of /var/tmp.
Also check under /var/spool and see if you have any large print jobs hung in the print queue.You can check this by running lpstat -o. Also run mailq to see if you have any mail messages hung in the mailq.

Check the size of /var/adm/syslog/syslog.log and possibly cut the size down on it if the system has been up for a long time.
MANOJ SRIVASTAVA
Honored Contributor

Re: Problems extending /var...

Hi Shaun,

/var hosts the following direcories which increase bcoz of logs

/var/adm/sa
/var/tmp
/var/adm/wtmp
/var/adm/syslog
/var/mail/*

incase you dont want these logs at all you can go ahead and delete the file under these directories , for wtmp reducve it to zero .

This would free up some space for you , as per increasing the size thoriugh online JFS do vgdispaly for that volume group and check for the free extents available , multiply by the PE size and you would get the total frre pace avialable in that volume group , onc eyou got that then you can just increase it by that size. Also if you are having probs with the command line try doing it through SAM as it ensures better execution of the task.

Manoj Srivastava

CHRIS_ANORUO
Honored Contributor

Re: Problems extending /var...

Hello Shaun,

Use cleanup -F. This will recover space from the old patch files. Also trim wtmp, preserve, and log files (using " > filename")
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
James R. Ferguson
Acclaimed Contributor

Re: Problems extending /var...

Hi Shaun:

If you want to cleanup files not needed in /var then do:

# cleanup #...without further arguments...
# cat /dev/null > /var/adm/wtmp #...if present
# remove old 'vi' recovery files in /var/preserve
# use SAM to trim other logfiles [SAM -> Routine Tasks]

If you are getting "...not enough free physical extents..." then:

> Make sure that you are correctly specifying the options to 'lvextend' (i.e. '-l' is extents, but '-L' is the size in MB; see the man page for 'lvextend'.

> Make sure that you don't (unlikely) have a requirement for contiguous allocation of /var (do a 'vgdisplay /dev/vg00/lvolX) and look at the "allocation" policy against the man pages for 'lvextend').

> If you have a mirrored logical volume, make sure that you have extents available *on the mirror*. See again, 'man lvextend'.

...JRF...
Thierry Poels_1
Honored Contributor

Re: Problems extending /var...

Hi,

instead of extending /var you could also move a part of it to a new filesystem; you could for example create a seperate filesystem for /var/adm.
just another option,
good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Wodisch
Honored Contributor

Re: Problems extending /var...

Hello Shaun,

as long as you do not show us a little bit more
information (like the output of "bdf", and "du -sk /var/*")
we can just guess - hence try the following:

1) try expanding your LV from command-line to see the
error message (assuming VxFS!!!):

lvextend -L 1024 /dev/vg00/lvolX # your "/var" LV
fsadm -F vxfs -b 1024M /var # the size in MB + 'M'
=> only works with the Online JFS/Advanced VxFS
AND you must have about 1MB free before!

if you do not have that, boot into single-user mode
(shutting down to it seldom works), then issue:
lvextend -L 1024 /dev/vg00/lvolX # your "/var" LV
extendfs -F vxfs /dev/vg00/rlvolX # your "/var" LV

2) commit your patches (HP-UX11) or use "cleanup"
(HP-UX10.x) to free the space in "/var/adm/sw/patch"

3) remove that old tombstones, core dumps, and crash
dumps, and everything in "/var/tmp/"

4) If you use the HFS, then check for free inodes:
bdf -i /var
perhaps you are not out of disk space, but out of
inodes?

5) Check your LV size: have you reached the 2GB limit?
You do need a lot of (current) patches for LVM, SCSI,
VxFS/HFS, and such, to be able to cross that border

If nothing works, tell us some more details, please.

HTH,
Wodisch