1761305 Members
3147 Online
108901 Solutions
New Discussion юеВ

swap space question

 
SOLVED
Go to solution
iambluegary
Advisor

swap space question

i know that :lvcreate -L 200 -n myswap /dev/vg01
could bulid a 200MB swap space,however i wanna know that how hpux could know that it should use this dir to swap,after all,'myswap' is just a name that can be changed to "yourswap" or something else.
help ,help,help :-)
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: swap space question

Hi:

You use the 'swapon' command to enable the paging. In turn, you specify the swap space in /etc/fstab. Have a look at the man pages (1M) for 'swapon'.

Regards!

...JRF...
Michael Tully
Honored Contributor

Re: swap space question

Once you've created your logical volume, you
need to use the swapon command to enable it.

e.g.
# swapon /dev/vg01/swap1

Add an entry like this to your /etc/fstab file
to ensure that is enabled next time your
system is booted.

/dev/vg01/swap1 ... swap pri=1 0 0


HTH
~Michael~
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: swap space question

Once you place it in the fstab as mentioned by Michael, you can use the command "swapon -a" to enable the new swap (similar to mount -a which is for the filesystems).

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Juan Manuel L├│pez
Valued Contributor

Re: swap space question

Use the swapon command.
Using LVM:
1. lvcreate -L 16 -n myswap /dev/vg01
2. swapon
3. Finaly, you have to put the new swap area on /etc/fstab, them the new swap will be activated every boot.

It is a good thing put the secondary swap on other disk than vg00.

I hope this answer can help you.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Trond Haugen
Honored Contributor

Re: swap space question

You are right HP-UX don't know by the lv-name that it's swap. It will have to be enabled as mentioned in previous posts.
Put it in fstab if you want it enabled at the next reboot. Ommit it if it's just for testing.
Also considder what priority you give it if you expect it to actuallu be used. You can check with 'swapinfo -tm' to see what is reserved and what is actually used. If it is on a disk with same or better access speed that existing swap give it the same prioriy. That way the load of swapping will be spread.
BTW the system shouldn't be swapping but paging. But swapping is a historic term and is used annyway.

Regards,
Tron
Regards,
Trond Haugen
LinkedIn