Operating System - HP-UX
1827808 Members
2893 Online
109969 Solutions
New Discussion

Re: Adding Secondary Swap File

 
Andrew Kaplan
Super Advisor

Adding Secondary Swap File

Hi there --

I am going to be adding an external drive to a Visualize C class system running 10.20. I plan on making a portion of the new disk, 1 GB, a secondary swap partition. My plan is to use SAM to complete this task. Is there anything in particular I should look for in SAM? Thanks.
A Journey In The Quest Of Knowledge
3 REPLIES 3
RAC_1
Honored Contributor

Re: Adding Secondary Swap File

Why exactly you are adding the swap space?? How much RAM you have?? and what is the swap space configured???

If enought swap space is configured, whay would one add secondary swap??

In case you still want to add it, the procedure is simple. Create a lvol.
lvcreate -L xxxM -Cy -r N /dev/vgxx
Add the line to the /etc/fstab

/dev/vgxx/lvolx ... swap pri=x 0 0
The priority can be set as you want. If you want to use secndary swap first, set the priority lower than the primary swap.

Anil
There is no substitute to HARDWORK
Jeff Schussele
Honored Contributor

Re: Adding Secondary Swap File

Hi Andrew,

Nothing in particular.
Just go to the Disks and File Systems section.
Then into Volume Groups -> Actions -> Create and choose the new disk, give the VG a name, optionally modify the defaults (do this if any more larger disks may be added to the VG). Then in this screen you can also create the new swap LV (Just make sure you define it as a swap device). That's all there is to it.

Of course it's usually faster from the command line - as follows:

pvcreate /dev/rdsk/cXtYdZ #(Use the appropriate new disk device)
vgcreate vg_name /dev/dsk/cXtYdZ
lvcreate -L 1000 -n lv_name vg_name
Edit the /etc/fstab & insert the following
/dev/vg_name/lv_name ... swap pri=0 0 0
Then run
swapon -a

NOTE: You may have to increase one of the following kernel parms to use more swap:
maxswapchunks
swchunk
Either/or will require a kernel rebuild & reboot.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Andrew Kaplan
Super Advisor

Re: Adding Secondary Swap File

We currently have to little swap set up and there is no additional filesystem space available to add to the primary swap file. Consequently, the move to add the external drive and make it a secondary swap file.
A Journey In The Quest Of Knowledge