Operating System - HP-UX
1752815 Members
5762 Online
108789 Solutions
New Discussion

Re: creating seconday device swap

 
SOLVED
Go to solution
NDO
Super Advisor

creating seconday device swap

Hi all!

 

I have a system running hp-ux 11.31 with 98200Mb of physical memory and 8192Mb of swap space:

#swapinfo -tam
             Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        8192       0    8192    0%       0       -    1  /dev/vg00/lvol2
reserve       -    8192   -8192
memory    93405   45505   47900   49%
total    101597   53697   47900   53%       -       0    -
mcel_VMhost2[161]/ #

 We have run the SHC script and one of the recomendations was to increase swap space to the value of 24550Mb.

 

The procedure that I want to follow is as follows:

 

from bdf output:

bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1048576  231824  810408   22% /
/dev/vg00/lvol1    1835008  192520 1629744   11% /stand
/dev/vg00/lvol8    8912896 5323944 3571568   60% /var
/dev/vg00/lvol7    6553600 2991776 3534008   46% /usr
/dev/vg00/lvol4    10485760  218096 10188064    2% /tmp
/dev/vg00/lvol6    10485760 5879944 4569936   56% /opt
/dev/vg00/lvol5     131072    5784  124440    4% /home

 

I should run the following commands:

 

lvcreate -C y -r n -L 8192 -n lvol9 /dev/vg00
swapon -p /dev/vg00/lvol9

 

lvcreate -C y -r n -L 8192 -n lvol10 /dev/vg00
swapon -p /dev/vg00/lvol10

 

lvcreate -C y -r n -L 8192 -n lvol11 /dev/vg00
swapon -p /dev/vg00/lvol11

 

Please correct me if I am wrong

 

 

 

5 REPLIES 5
Patrick Wallek
Honored Contributor
Solution

Re: creating seconday device swap

I would just create a single LV of the size you want.  When you activate you specify a differrent priority than your primary swap device.

 

lvcreate -C y -r n -L 24576 -n lvol9 /dev/vg00
swapon -p 2 /dev/vg00/lvol9

 

Also make sure you add the apporpriate line to your /etc/fstab file so that the swap area will be activated automatically when the system boots.

 

Adding the following to /etc/fstab will accomplish this:

 

/dev/vg00/lvol9 ... swap pri=2 0 0

Avinash Agarkar
Valued Contributor

Re: creating seconday device swap

I suggest to use below because swap should be always "strict/contiguous" .

 

 

lvcreate -s y -C y  -r n /dev/vg_swap

 

lvextend -L size /dev/vg_swap/lvname perticular disk

 

put entryies as other server in /etc/fstab

 

swapon -a

 

Thanks,

Avinash

Great Power Comes With Great Responsibility
NDO
Super Advisor

Re: creating seconday device swap

Hi

 

Thank you very much, I´ve follow your suggestion, and its now ok:

 

lvcreate -C y -r n -L 24576 -n lvol10 /dev/vg00
Logical volume "/dev/vg00/lvol10" has been successfully created with
character device "/dev/vg00/rlvol10"

 

swapon -p 2 /dev/vg00/lvol10

 

swapinfo -tam
             Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        8192       0    8192    0%       0       -    1  /dev/vg00/lvol2
dev       24576       0   24576    0%       0       -    2  /dev/vg00/lvol10
reserve       -    8234   -8234
memory    93405   48272   45133   52%
total    126173   56506   69667   45%       -       0    -

 thank you

singh sanjeev
Trusted Contributor

Re: creating seconday device swap

does mirroring of seconday swap is not required.
Sanjeev Singh
Torsten.
Acclaimed Contributor

Re: creating seconday device swap

>> does mirroring of seconday swap is not required.

Not sure if this is a question or statement.

Consider this: if the physical device where the swap resides fails or is inaccessible, the server will crash. As long as the disk space is not provided from an already mirrored or otherwise protected storage (array), this creates a critical SPOF.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!