Operating System - HP-UX
1752475 Members
6320 Online
108788 Solutions
New Discussion юеВ

Reduce the size of Primary Swap

 
SOLVED
Go to solution
Chris Fung
Frequent Advisor

Reduce the size of Primary Swap

Hi,

I would like to reduce the size of the primary swap space which is too large (2048MB) and I just want to split it into 2 physical disk to gain the performance. Therefore reduce the Primary to 1024 and then add another secondary swap 1024. By the way, my machine L1000 is equipped 1024MB RAM

Are there anyways to accomplish this? Thanks,

Chris,
4 REPLIES 4
Uday_S_Ankolekar
Honored Contributor
Solution

Re: Reduce the size of Primary Swap

Hi,

First, ensure that swapmem_on is set to "1" to enable psuedo swap:

sysdef | grep swapmem_on

Next, verify that there is a good backup of the root volume group:

lvlnboot -v /dev/vg00

Record the logical volume name information. Then backup a copy of
the vg00 configuration:

vgcfgbackup -f [filename] /dev/vg00

Finally, follow the procedure below to reduce swap dump.

A. Boot Psuedo-SWAP for decreasing size of Primary SWAP:

1. Display the current root and swap volumes:

lvlnboot -v /dev/vg00

Note: lvol2 is the default primary swap.

2. Remove the swap and dump link to the current primary swap.

lvrmboot -s /dev/vg00
lvrmboot -d /dev/vg00/lvol2

B. Reboot the system into LVM maintenance mode:

1. Reboot:

a. shutdown -ry 0
b. at ISL> hpux -lm (;0)/stand/vmunix

2. vgchange -a y vg00

3. lvreduce -L XXX /dev/vg00/lvol2

Note: XXX is the new size of lvol.

4. Recreate a swap and dump link with the lvol:

lvlnboot -s lvol2 /dev/vg00
lvlnboot -d lvol2 /dev/vg00

5. Relink:

lvlnboot -R /dev/vg00

6. Reboot:

shutdown -ry 0



Goodluck,
-USA..
Good Luck..
Sridhar Bhaskarla
Honored Contributor

Re: Reduce the size of Primary Swap

Hi Chris,

It is a good idea. However before creating the secondary swap, make sure it is on another disk otherwise there is no point.

This procedure can also be used to extend /stand file system. Go ahead if you want by removing lvol2, extend stand and then recreate lvol2.

***Make sure you have a make_recovery tape prior to following the procedure****

This is basically from Resource Center DocID: KBRC00004288

//start

PROBLEM
What is the procedure to reduce primary swap on the system?

RESOLUTION
First, ensure that swapmem_on is set to "1" to enable psuedo swap:

sysdef | grep swapmem_on

Next, verify that there is a good backup of the root volume group:

lvlnboot -v /dev/vg00

Record the logical volume name information. Then backup a copy of
the vg00 configuration:

vgcfgbackup -f [filename] /dev/vg00

Finally, follow the procedure below to reduce swap dump.

A. Boot Psuedo-SWAP for decreasing size of Primary SWAP:

1. Display the current root and swap volumes:

lvlnboot -v /dev/vg00

Note: lvol2 is the default primary swap.

2. Remove the swap and dump link to the current primary swap.

lvrmboot -s /dev/vg00
lvrmboot -d /dev/vg00/lvol2

B. Reboot the system into LVM maintenance mode:

1. Reboot:

a. shutdown -ry 0
b. at ISL> hpux -lm (;0)/stand/vmunix

2. vgchange -a y vg00

3. lvreduce -L XXX /dev/vg00/lvol2

Note: XXX is the new size of lvol.

4. Recreate a swap and dump link with the lvol:

lvlnboot -s lvol2 /dev/vg00
lvlnboot -d lvol2 /dev/vg00

5. Relink:

lvlnboot -R /dev/vg00

6. Reboot:

shutdown -ry 0

//END


If anything unexpected happens, boot through ignite tape and change the primary swap during the installation process.

Good luck.

-Sri







You may be disappointed if you fail, but you are doomed if you don't try
Sanjay_6
Honored Contributor

Re: Reduce the size of Primary Swap

Sean OB_1
Honored Contributor

Re: Reduce the size of Primary Swap

I know this is very old but I wanted to add a correction for anyone that tries to do this from the post.

This step is wrong:

2. Remove the swap and dump link to the current primary swap.

lvrmboot -s /dev/vg00
lvrmboot -d /dev/vg00/lvol2



it should be:

2. Remove the swap and dump link to the current primary swap.

lvrmboot -s /dev/vg00
lvrmboot -d /dev/vg00/lvol2 /dev/vg00