Operating System - HP-UX
1849592 Members
7339 Online
104044 Solutions
New Discussion

Can /tmp be reduced on a HP-UX 11.0 server?

 
SOLVED
Go to solution
Gino Castoldi_2
Honored Contributor

Can /tmp be reduced on a HP-UX 11.0 server?

Hi,

Server: HP-UX 11.0 L2000

Can the filesystem /tmp be reduced using LVM and/or VxFS? A 'df -n' command shows that(/tmp) is a VxFS filesystem.

The reason why I am thinking of doing this is that my swap is probably too small and the VG (vg00) has no more free space/blocks left to allocate. It looks like reducing the filesystem
in VG=vg00 and using the freed up space for swap is possibly my only option.

(10 points for any good answer).
Thank you Gino Castoldi
10 REPLIES 10
Sanjay_6
Honored Contributor
Solution

Re: Can /tmp be reduced on a HP-UX 11.0 server?

Hi Gino,

Try this,

1.) Go to single user mode or boot into single user mode
2.) Execute lvreduce -L size_in_mb /dev/vg00/lvol7 (this is /tmp)
3.) Execute newfs -F vxfs /dev/vg00/rlvol7
4.) Reboot.

Hope this helps.

Regds
James R. Ferguson
Acclaimed Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

Hi Gino:

You could reduce /tmp if you want.

If you have Online JFS you might be able to do this. However, unless you have Online JFS 3.3, I personally wouldn't bother to try. The predecessor version (3.1) SOMETIMES allows file shrinkage if first you defragment and if no inuse blocks are present in the extents to be reduced. Collective experience indicates the failure for shrinkage to succeed is high.

In the absence of Online JFS, you can 'lvreduce' the logical volume and then 'newfs' the filesystem. Normally you would then reload its data, although in the case of /tmp there is no need. I should hasten to add that this would apply to 'hfs' as well as 'vxfs' filesystems.

*BUT NOTE* that a large /tmp filesystem has advantages. Since un-sharing patches requires space in /tmp, and since patches can be rather large, I'd give consideration to retaining a good-size filesystem.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

Yes, you could drop to single-user, and reduce the size of /tmp. Since, you are going to place more swap on what appears to be the same physical device make certain that you do not the new swap a priority level of 1. Primary swap and this new swap will be interleaving on the same device. You can imagine what the head positioning mechanism will be doing. Before I did all this I would make sure that I really needed more swap. If your machine has lots of memory, the old 2x-3x RAM rule for swap very seldom applies. If you are paging out fairly often and you have reduced or disabled dynamic buffer cache and have not enabled pseudo-swap then you do need more swap. If you only want toi increase swap to give yourself a 'safety net' AND you don't really swap very often, I would consider using filesystem swap at low priority. It would then only come into play when all the other swap has been used.


If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

It would be difficult to reduce /tmp, so that you can extend primary swap. The problem is that / (lvol1), primary swap (lvol2) and /stand (lvol3) must all be contiguous. So if you reduce /tmp (lvol6 by default) then you would somehow have to relocate all extents used by the other LVs, move /stand to free up extents that are contiguous with pri. swap. If you just have a single disk, or a mirrored pair, for VG00, then this is next to impossible without rebuilding your system from an Ignite/UX make_tape_recovery tape.

You could install Ignite/UX ( http://software.hp.com/products/IUX ), create a make_tape_recovery tape, boot from the tape interactively and change the sizes of pri. swap and /tmp so that they are the size you need. This too, though fairly simple, would be a pain in the butt.

The thing I would do is just create another swap LV in one of your other VGs on the system and activate it. If you like, you can create it the same size as your primary swap, and make sure it is used at the same priority as primary swap, and the two areas will get used equally.

Hope all this makes sense.
Thierry Poels_1
Honored Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

Hi,

how about creating a secondary swap space in another Volume Group. More than 1 swap space have its advantages for I/O tuning.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
harry d brown jr
Honored Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

As long as you keep at least 100-250mb in /tmp you can reduce it, but offline. To add more swap, you can use filesystem swap that does not have to be part of VG00! or even more disk swap in another VG. It all does not have to be part of VG00! And it makes MORE sense to distribute SWAP across MULTIPLE spindles.


live free or die
harry
Live Free or Die
Craig Rants
Honored Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

If you have Online JFS you could do

fsadm -F vxfs -d -D -e -E /tmp
fsadm -F vxfs -b NEW_SIZE_IN_KB /tmp
lvreduce -L NEW_SIZE_IN_MB /dev/vg00/lvolx

As pointed out, the success rate is not 100%, however /tmp probably has a higher probability.

Good Luck,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Deshpande Prashant
Honored Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

Hi
If you want additional swap space, create secondary swap on different disk/VG.

Thanks.
Prashant.
Take it as it comes.
Roger Baptiste
Honored Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

<>

Yes, technically it is possible to do it. But, be
sure whether you really want to do it; what is the size of /tmp ?? it is good to have
it around 70Mb (or upto 100Mb incase of a huge system).

Once you decide,you really want to remove it, make sure
you don''t have any files in it which you need later. Or better make a backup copy of the whole filesystem. The FSreduction will whack out the contents of /tmp.

The way to do this is:
#take downtime
#shutdown -r -y now
#boot in single user mode
#ISL>hpux -is
#lvreduce -L /dev/vg00/lvol??
(make sure it is /tmp LV!).
#newfs -F vxfs /dev/vg00/rlvol??
**

<>

If the swap is small, you have the option of creating additional swap on other disks! Please note you cannot extend Primary swap!! since it needs contiguous extents. So even if you free up space from /tmp, you would not be able to use it for extnding perimary swap.

<in VG=vg00 and using the freed up space for swap is possibly my only option.>>

Sorry, you cannot do that! But you can create a new swap with the freed space, which is not advisable, since the the swap sizes should prerably be the same.

<<(10 points for any good answer). >>

Nice bait ;-)

-raj
Take it easy.
Krishna Prasad
Trusted Contributor

Re: Can /tmp be reduced on a HP-UX 11.0 server?

You can reduce /tmp with online jfs but you will lose what you have in tmp until you can restore it.

The filesystem will be corrupted after you reduce it with lvextend. Since it is tmp you prop. don't care to much. But after you reduce it. I would recreate it quickly and re-mount. This will free up as much space as you reduced it.

Also ....How big is /tmp on your machine.
How much can you really gain? How much more swap space do you need?
Positive Results requires Positive Thinking