1843341 Members
3909 Online
110214 Solutions
New Discussion

how to decrease swap

 
SOLVED
Go to solution
reuben_8
Occasional Contributor

how to decrease swap

N4000,HPUX 11.00,4G MEM,2*18G DISK(MIRROR,8G FOR ONE SWAP,ONLY 10G AVAILABLE)
I NEED 3G FOR OTHER APPLICATION,SO DECIDE DECREASE 8G SWAP TO 4G SWAP,HOW TO DO,THANKS.
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: how to decrease swap

Hi:

From the information you have provided, I assume that you mean "primary swap". In that case, see this Technical Knowledge Base document: # KBRC00004288.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: how to decrease swap

If you have only one swap area, reducing it can only be done in single user mode and may not be successful (load and run Ignite/UX to backup vg00). Boot up and interrupt the boot process. Then boot from primary and say YES to the interact question. Type in the command:

hpux -is

And you'll be in single user mode. Use lvreduce to change the lvol size for the swap disk, then use the command:

reboot -q

to restart. This should come up in multi-user mode with the smaller swap area (use swapinfo -tm for assistance). If this does not work, user your make_tape_recovery tape to restore HP-UX and during interactive restore, setup a different size for the primary swap area. This technique has the advantage of leaving the unused space at the end of the disk.


Bill Hassell, sysadmin
John Bolene
Honored Contributor

Re: how to decrease swap

and you will need to turn on pseudo swap if you have not done so

kernel parm

swapmem_on 1

It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
T G Manikandan
Honored Contributor
Geoff Wild
Honored Contributor

Re: how to decrease swap

If it's primary swap - then you need to boot to LVM maintenance mode
(hpux -lm at ISL>)


# vgchange -a y /dev/vg00
# lvrmboot -r /dev/vg00

If your swap is lvol2:

# lvremove /dev/vg00/lvol2
# lvcreate -L 4096 -C y -r n -n lvol2 /dev/vg00
# lvlnboot -b /dev/vg00/lvol1
# lvlnboot -r /dev/vg00/lvol3
# lvlnboot -s /dev/vg00/lvol2
# lvlnboot -d /dev/vg00/lvol2
# lvlnboot -R
# reboot -r


Read the man pages on lvlnboot...the above assumes stand is lvol1, swap is lvol2, and / (root) is lvol3

Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Dave Wherry
Esteemed Contributor

Re: how to decrease swap

I think something got buried in Bill Hassell's reply. He said "it can only be done in single user mode and may not be successful". Then in paren's he mentioned Ignite.
Since it is questionable whether you will be successful trying to reduce it in single user mode I would suggest you create a make_tape_recovery tape and rebuild from that. It is safe and will work.
Geoff Wild
Honored Contributor

Re: how to decrease swap

Make_tape_recovery should be done - as a backup. But it is not necessary to reduce /stand.

The procedure I gave above (boot to LVM Maintenance mode - NOT single user) works - I know - just did it last Saturday on a N Class...

I found that procedure searching these forums...

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.