1833738 Members
2448 Online
110063 Solutions
New Discussion

Re: Add swap space

 
Achilles_2
Regular Advisor

Add swap space

Instead using SAM, what is the step to add swap space? I am the beginner, I just know swapon command but no more idea how to use correctly

thanks for your advise
5 REPLIES 5
RAC_1
Honored Contributor

Re: Add swap space

Create lvol (better if you create on differnt disk than primary swap disk)
lvcreate -L "xxM" -C y -r n /dev/vgxx
swapon -p "same_priority_as_primary_swap" /dev/vgxx/lvolx

(Same priority gives advantage of round robin swapping and is helpful)

Update /etc/fstab as follows.

/dev/vgxx/lvolx . swap pri=x 0 0

Depending upon your maxswapchunks settings, you may need to tune it to reflect additional space configured for swap.
There is no substitute to HARDWORK
Muthukumar_5
Honored Contributor

Re: Add swap space

Create lv with lvcreate as,

#lvcreate -L 16M -n myswap /dev/vg01 (swap size is 16MB)

Add swap as,

#swapon /dev/vg01/myswap

hth.
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Add swap space

A great document,
http://docs.hp.com/en/B2355-90672/ch06s03.html
[HP-UX System Administration Tasks > Chapter 6. Managing Swap Space and Dump Areas
Designing Your Swap Space Allocation]

http://docs.hp.com/en/B2355-90672/ch06s04.html?btnNext=next%A0%BB
[Adding, Modifying, or Removing Device Swap]

# man swapon will also help

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Alex Lavrov.
Honored Contributor

Re: Add swap space

A little addtion.

User "swapon -f".

-f - very important, forces swapon to use the whole logical volume, because if there once a filesystem and lvol, it will recognize it and use the space that left after the FS.

I had this thing once and eventually had to reboot the machine to get rid of 12MB swap. Well, learned my lesson.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Stuart Abramson
Trusted Contributor

Re: Add swap space

Swap must be contiguous. lvcreate must have parameter "-C y". RAC had it right. Muthukumar forgot it.