LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I increase my swap space on RH Linux AS 4.0 (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-increase-my-swap-space-on-rh-linux-as-4-0-a-520493/)

pdillard 01-18-2007 07:58 AM

How do I increase my swap space on RH Linux AS 4.0
 
I am runnint "Linux beaurac2.beaumont.edu 2.6.9-42.0.2.ELlargesmp #1 SMP x86_64 GNU/Linux".

Swap space is currently set at 8gig on logicla volume "/dev/osvg/swap".
I need to increase my swap space to approximately 10gig for my 10gR2 RAC linux install.

I am using logical volume manager but I am not able to make any changes to the swap space.

Can some one tell me how to increase my swap space?

Lenard 01-18-2007 09:10 AM

Read the man pages for mkswap and swapon;

man mkswap
man swapon

Or contact Red Hat support for assistance.

MensaWater 01-18-2007 09:26 AM

Of course before you can use those commands for adding to swap you'll have to either increase your existing logical volume (LV) or add another one. I'd suggest the latter just because it is easier.

vgdisplay /dev/osvg # Will show you how much space if any you have left in the Volume Group (VG) named osvg.

You can use the lvcreate command to create another LV using the space needed assuming you have space in the VG.

There is an lvextend command as well but I'm not sure you could just extend a swap LV and have it work. At a minimum you'd have to reboot - and it might not even allow you to do the extend because swap is in use. You might have to do something like:
-Comment out the swap entries in /etc/fstab
-Boot the system (swap won't start)
-Do the lvextend on the swap LV
-Use the swap commands to insure the new LV is fully set as swap.
-Uncomment the swap entries in /etc/fstab
-Reboot the server and verify you have the correct amount of swap.

I'd caution you on the Oracle specifications though. So far as I can tell they just base what they tell you on the machine they happened to have been on rather than actually checking requirement. I once saw a specification for shared memory max (shmmax) kernel parameter that was larger than my machine's physical memory. The system ran just fine once I allocated what seemed a much more reasonable number.

10GB swap should mean you have at least 5GB physical memory (using the old rule of thumb Swap = 2 x Physical. Some people just do 1 x Physical. The swap won't really let you increase your SGA though - that resides in shared memory (shmmax, shmmni etc... are the kernel parameters for that).

Of course the SGA is for the DB server. For the apps (middle tier) swap probably have more of an impact though they aren't really memory intensive the way the DB is.

By the way: We have RAC 10g Lite on RHEL AS 3 and only have 5 GB swap configured there.

arpflux 01-19-2007 02:37 AM

To extend the existing LV, refer to the ffg as a guide. But as suggested earlier, its a good idea to just create a new LV or file to add as a swap.

- Disable the swap for the associated logical volume.

swapoff -v /dev/osvg/swap

- Resize the LV.

lvresize -L +1000M /dev/osvg/swap

- Format the new swap space.

mkswap /dev/osvg/swap

- Enable the swap on the extended LV.

swapon -va

- Test that swap has been extended properly.

cat /proc/swaps
free


All times are GMT -5. The time now is 02:23 PM.