1833013 Members
2904 Online
110048 Solutions
New Discussion

Increase of swap space

 
SOLVED
Go to solution
Ricky_2
Frequent Advisor

Increase of swap space

Hi, I need to increase the size of my default swap space but the disk is already full. How do I specify that the additional space should go to another disk since the contiguous policy is set. Thanks.
9 REPLIES 9
harry d brown jr
Honored Contributor
Solution

Re: Increase of swap space


You can either add secondary swap or rebuild your system with a make_tape_recovery and extend swap to the size you want it to be.

lie free or die
harry
Live Free or Die
Ricky_2
Frequent Advisor

Re: Increase of swap space

Hi Harry, I'm running JFSOnline and I can increase the space on the fly but now I do not have enough space on the one disk. Is there a way I can mirror the swap space to another disk in vg00, remove the original copy, and extend the size of swap on the new disk? Thanks.
Vincent Farrugia
Honored Contributor

Re: Increase of swap space

Hello,

The only way to do it is to add a secondary swap.

lvcreate -L size vgxx
Add line in /etc/fstab as follows:
/dev/vgxx/lvoly /swap/swap defaults 0 0
swapon -a

where size is the size ofthe additional swap space you want
vgxx is the vg where you want the new swap to be
lvoly is the name of the new logical volume swap.

Before that, you need to add a new disk and vgextend it to your current vg.

HTH,
Vince
Tape Drives RULE!!!
Ricky_2
Frequent Advisor

Re: Increase of swap space

Hi, I just came across the pvmove command. Can that be used to move the swap lv to another disk? Thanks.
Pete Randall
Outstanding Contributor

Re: Increase of swap space

Ricky,

Regardless of the contiguous policy, you can add secondary swap on another disk. There is no need to move your existing swap.

Pete

Pete
Ricky_2
Frequent Advisor

Re: Increase of swap space

Hi Pete, I'm sorry that I didn't make myself clear. I need to extend the pri swap to my RAM size because I'm using it as a dump dev. My RAM is 2GB and currently the swap is only 1GB. Thanks.
Vincent Farrugia
Honored Contributor

Re: Increase of swap space

Hello,

Yes, you can define an additional secondary swap for that.

If your primary swap is 1Gb, define a secondary swap of let's say 1Gb, so that your total will be 2Gb of swap space.

Use the cookbook I gave you earlier.

HTH,
Vince
Tape Drives RULE!!!
Pete Randall
Outstanding Contributor

Re: Increase of swap space

Ricky,

In that case, your best bet would be to build an Ignite tape with make_tape_recovery, as Harry suggested, and use it to rebuild your system. You can resize things during the reload.

Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Increase of swap space

Hi Ricky:

First, 'pvmove' can move logical volume extents only *within* a volume group's physical volumes. If you have only one physical volume comprising a volume group, 'pvmove' has no meaning. If you had a volume group of two or more physical volumes, you could use 'pvmove' to rearrange logical volumes. Accomodating the enlargement of the primary swap device by this method is difficult at best. It is easier to find other contiguous space on the root volume group and create a new primary swap there. Alternately, you could use an Ignite recovery tape to resize your filesystes (including primary swap) during a reinstall.

It is far easier to create a secondary device swap on another (non-vg00) volume group and specify an equal swap priority to achieve an interleaving of I/O for best performance.

However, it appears that you really want to increase dump space which is currently shared with your primary swap. If this is the case,
you can create a new logical volume (either in vg00 or in a new volume group).

Add an entry to '/etc/fstab' that looks like:

/dev/vg01/lvol1 ... dump defaults 0 0

Then, modify '/etc/rc.config.d/crashconf' to:

CRASHCONF_READ_FSTAB=1

Finally, to verify, do:

# /sbin/crashconf -a
# /sbin/crashconf -v

For more information, see the "System Crash Dump" white paper:

http://docs.hp.com/hpux/onlinedocs/os/syscrash.html

Regards!

...JRF...