1837896 Members
3474 Online
110122 Solutions
New Discussion

Moving primary swap

 
Ivan Efimenko
Contributor

Moving primary swap

We have primary swap configured on /dev/vg00/lvol2. We would like to move it to the whole disk, which is not added to LVM. How can we do it?
And, then, we would like move secondary swap to old primary's place.
4 REPLIES 4
Glen Olsen
Occasional Advisor

Re: Moving primary swap

I don't beleave it is possible to have your primary swap anywhere but on the root (booting) volume group, what I have done in the past is to reduce lvol2 to 1 logical extend then have a large secondary extend somewhere else. (I have done this on a couple of systems and improved the preformance of the system greatly.

You can could then use the rest of the old lvol2's extents to increase other vg00 LV's or create a new LV for more secondary swap or another file system.
Victor BERRIDGE
Honored Contributor

Re: Moving primary swap

Hi,
Yes you can do such things:
# swapinfo
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 266240 0 266240 0% 0 - 1 /dev/vg00/lvol2
dev 262144 0 262144 0% 0 - 0 /dev/r5vg01/lvol9
reserve - 285820 -285820

Only I dont remember how I did it..., at that time it made sense: the external disks were on raid5 FW/DIFF and much faster than the internal SE-SCSI mirrored rootvg. If I dont remember it means it was something obvious... like declaring your new swap then change its priority= the secondary becomes primary swap and Im sure it can be done trough sam...

Good luck
All the best
Victor
Russell Davy
Advisor

Re: Moving primary swap

Hey Ivan
Check out the -p option in swapon in the man (1M) swapon, it talks about priorities, remember that DEV swap will be used before FS swap. The default priority is 1, however, if you add your new swap area with SAM, you can change the priority to 0, a higher priority area (or modify /dev/vg00/lvol2 to say priority 2).
Also check "default allocation pages" area in the man (1m) swapinfo...

MND
Bruce Regittko_1
Esteemed Contributor

Re: Moving primary swap

Hi,

Keep in mind that the dump device is often the same as the primary swap device. If you have a kernel panic and the dump device is tiny, then the dump will be incomplete. You can check what you dump device is with lvlnboot -v.

--Bruce
www.stratech.com/training