1847260 Members
3959 Online
110263 Solutions
New Discussion

Re: Adding swap

 
SOLVED
Go to solution
Andreas Voss
Honored Contributor

Adding swap

Hi,

i have a system with mirrored vg00 (2 x 4GB)and have to increase swap but there is not enough space in vg00.
So i bought two additional disks (4GB) and put them into my HASS enclosure. These new disk should also be mirrored.

Now i'm not sure how to add the swap.
Should i add the disks into vg00 (vgextend)
or
create a new vg and add them there ?

Kind Regards

Andreas
9 REPLIES 9
Jeff Machols
Esteemed Contributor

Re: Adding swap

you can only extend the current vol if it can be contiguous. If not you will have to create a new LV. Just use the swapon command for this (it will require a reboot though).

man 1m swapon
Rita C Workman
Honored Contributor

Re: Adding swap

It can be a 6 of one half dozen of the other...but for myself. I tend to set the second set of disks as part of vg00 and then define a good size lvol for swap. That way in a pinch I can still extend something in vg (if I have to buy time) before getting the next set of disks to add..

Just my way of doing things,
Rita
S.K. Chan
Honored Contributor

Re: Adding swap

I would create a separate vg for it. After that you can do this to create your addl swap.

# lvcreate -L 400 -n swap2 -C y -r n /dev/vg01
==> create 400MB contigous lv called swap in vg01 with bad block reallocation turned off

# swapon -p 1 /dev/vg01/swap2
==> enable swap with priority 1.

# swapinfo -ta
==> check to see if added swap is enabled.

# vi /etc/fstab
....
/dev/vg01/swap2 ... swap pri=1 0 1
....

Uday_S_Ankolekar
Honored Contributor

Re: Adding swap

Hi,
Hi
I would create new VG and than use priority

The following doc might useful

http://us-support2.external.hp.com/cki/bin/doc.pl/sid=c13f35fc11a4d6f7e3/screen=ckiDisplayDocument?docId=200000053039597
-USA..
Good Luck..
Helen French
Honored Contributor

Re: Adding swap

hey,

If you are looking for a secondary swap space, then you can create a new VG, then create new lv and mirror it. U can add this new lv as the new swap space.

There is no problem in adding this to vg00 and doing the same thing.

Shiju
Life is a promise, fulfill it!
Steven Gillard_2
Honored Contributor

Re: Adding swap

My advice would be to add the volumes to vg00, because then you can use the swap vols as dump volumes as well with lvlnboot. I'd also leave as much free space on the disks as possible as its always good to have some available in vg00.

Regards,
Steve
Thierry Poels_1
Honored Contributor

Re: Adding swap

hi,

let's start a fight about this ;-)
Personally I don't think it really matters if you create a new Volume Group or add them to VG00; it's up to you, your habbits, company policy, whatever,... Both have some advantages and disadvantages, but no real winner or loser on both.

But if you add them to VG00, make sure the new swap space resides completely on the new disk, or that a different swap priority is assigned. You really do not want to round-robbin between swap spaces on the same disk ;-)

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.