Operating System - HP-UX
1752866 Members
3604 Online
108791 Solutions
New Discussion юеВ

how to set swapinfo on disk

 
SOLVED
Go to solution
rustam_2
Super Advisor

how to set swapinfo on disk

Hi all,
My server has little RAM and swap spaces and coz of these my oracle databases gives error. I decided to increase my swap area by using disk arrays space. I created new Vdisk(24Gb) on EVA and presentationed to my server. The number should be - disk33. SAM shows me following information (on attached file).
What should i do now? how to set this value to my server? I read these articles and aren't clear properly. I'm afraid do mistake, because it's production server. Also i need no rebooting.

thanks,

Rustam.
11 REPLIES 11
ani007
Super Advisor

Re: how to set swapinfo on disk

Dennis Handly
Acclaimed Contributor

Re: how to set swapinfo on disk

>SAM shows me following information (on attached file).

You forgot to attach it.
What HP-UX version are you using?
SAM should be able to allocate swap on that new device.
rustam_2
Super Advisor

Re: how to set swapinfo on disk

omg, i forgot. I've attached now
ani007
Super Advisor

Re: how to set swapinfo on disk

Dennis Handly
Acclaimed Contributor

Re: how to set swapinfo on disk

>I've attached now

I'm not sure if SMH is showing your new disk?
The highlighted lvol2 seems like your existing swap.
rustam_2
Super Advisor

Re: how to set swapinfo on disk

Hi Ani and Dennis,

Ani, so i have to create second swap area? should i use lvcreate and then swapon commands? is it safe?
# lvcreate -C y -r n -L 32768 -n lvolN /dev/vgXX
# swapon -p /dev/vgXX/lvolN

will be my command like this:
#lvcreate -C y -r n -L 32768 -n lvolN /dev/disk33

# swapon -p /dev/vgXX/lvolN

lvolN - where can i find\determine N?


Dennis,
my OS version 11.3

regards,
Rustam
Dennis Handly
Acclaimed Contributor

Re: how to set swapinfo on disk

>so I have to create second swap area? should I use lvcreate and then swapon commands?

It might be safer if you can get SMH do do everything for you. Is there a builtin task for this?
ani007
Super Advisor

Re: how to set swapinfo on disk

Create lvol (better if you create on differnt disk than primary swap disk)

#lvcreate -L "xxM" -C y -r n /dev/vgxx
Add swap as,

#swapon -f /dev/vgXX/myswap

then edit fstab
/dev/vgxx/lvolx . swap pri=x 0 0

[Swap must be contiguous. lvcreate must have parameter "-C y".

-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 have not worked on 11.31.DEnnis, pls correct me if i am wrong.
Regards,
Ani
EmmanuelK2
Advisor
Solution

Re: how to set swapinfo on disk

Hello Rustam,
You can choose to use device swap, or file system swap.

To enable device swap, run the command below:
"swapon /dev/disk/disk33"

To enable file system swap, create a file system within the logical volume, turn on swap as below:
"newfs -F {vxfs/hfs} /dev/vgoo/lvol2"
"swapon /dev/vgoo/lvol2"

You can notice in your output that the logical volume /dev/vgoo/lvol2 does not have a mount point. After enabling swap, create a mount point for the logical volume as below:
"mkdir /swap2"
"mount /dev/vgoo/lvol2"

Recall that this mount point will not be available after a reboot. To make it permanent, make an entry in the /etc/fstab file as below:
"vi /etc/fstab"
add this line
"/dev/vgoo/lvol2 /swap2 swap defaults 0 0"
save and quit: issue the "mount -a" command to re-read the file into the system.

Regards,
Emmanuel