Operating System - Linux
1754403 Members
3266 Online
108813 Solutions
New Discussion юеВ

Increase swap space on RedHat9

 
Ragni Singh
Super Advisor

Increase swap space on RedHat9

Hi all, how do I increase swap space on RH9. I used LVM to create a 3gig filesystem and assign it all swap space but actually needed a 4 gig filesystem to do that. Someone pls help. Points will definitely be assigned.
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: Increase swap space on RedHat9

One thing is you need to analyze whether more swap is going to help.

Making swap more than twice physical memory can slow systems down. You may have an overloaded system that needs more memory.

But you asked about swap.

If you used lvm to create it, here is the command set to increase it. As I recall, swap needs to be contiguous.

lvextend -L 4048 /dev/vg00/swap /dev/dsk/#####

You will need to change the name of the logical volume to meet your system and use a real disk.

I draw this information from my HP-UX lvm skills. I don't use lvm on Linux because I can't mirror with it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Paulo A G Fessel
Trusted Contributor

Re: Increase swap space on RedHat9

Sanjay,

Have you read the answers users provided on the original thread you started?

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7edf52b400a43d4d8c930f1540c834f4,00.html

Next time, please look more carefully before starting another thread asking EXACTLY the same question. And don't forget to assign points accordingly.

[]'s
Paulo Fessel
L'employ├Г┬й propose, le boss dispose.
Paulo A G Fessel
Trusted Contributor

Re: Increase swap space on RedHat9

Steven,

It seems that Sanjay allocated a wrong amount of swap space and filled the remainder with file system(s). So he either would need to reduce the other file system(s) before changing swap size or creating a complementary swap file with 1 GB in size.

Contrary to HP-UX, there's no need in Linux to swapspace being continuous:

[root@wotan proc]# more /proc/swaps
Filename Type Size Used Priority
/dev/ide/host0/bus0/target1/lun0/part3 partition 530136 0 -1
/dev/mediavg/swap partition 524280 0 -2
[root@wotan proc]# lvdisplay -v /dev/mediavg/swap
--- Logical volume ---
LV Name /dev/mediavg/swap
VG Name mediavg
LV Write Access read/write
LV Status available
LV # 2
# open 1
LV Size 512 MB
Current LE 128
Allocated LE 128
Allocation next free
Read ahead sectors 1024
Block device 58:1

--- Distribution of logical volume on 2 physical volumes ---
PV Name PE on PV reads writes
/dev/ide/host0/bus0/target1/lun0/part2 64 1 3
/dev/ide/host0/bus0/target0/lun0/part9 64 0 0

Here, I created a swapspace of 512 MB, which is comprised of 2 256 MB chunks. Ok, this may hinder performance if your chunks are all on the same disks, but there are no limitations whatsoever about how to set-up your swapspace.

[]'s
Paulo Fessel
L'employ├Г┬й propose, le boss dispose.