Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I have a live server, with 512 MB of ram and you can see ram is running low. I want to avoid increasing the ram if possible due to ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Question Want to increase SWAP on Live Server - Is is ok? Fedora 6



    Hi,

    I have a live server, with 512 MB of ram and you can see ram is running low. I want to avoid increasing the ram if possible due to the added monthly cost.

    I wanted to know if I can increase the allocated swap ram on a live server? Basically the hosting provider has allocated a very small amount of swap memory and i have lots of hard drive space. I want to allocate at least 1024 MB of swap space.

    1) Can i increase the swap space with out causing stability issues

    2) If so how do i increase swap space in fedora on life system. I am a relitave newbie so please provide detailed explanation.

    Your assistance is greatly appreciated

  2. #2
    Super Moderator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,971
    Hiya swap_t, Welcome!
    I think you could do this fairly easily, with minimal disruptions by creating the new swap partition and enabling that new swap partition, without even turning the old swap off.
    Of course you need to do some reading, and studying, so I recommend the man pages.
    man swapon
    man swapoff
    man fdisk
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this. and the Forum FAQS.

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Can you send me a link?

    Thanks Mike!

    Do you have any links in particular that you would recommend. Again I do not want to destabilize the server and thus the extra caution.

    Thanks for the feedback again.

  4. #4
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,323
    If you have a free partition, you could use mkswap to create swap space on it and turn on the swap space using swapon. If you do not have a free partition, then you could create a swap file instead. This article may help.

  5. #5
    Just Joined!
    Join Date
    Sep 2007
    Location
    Virginia
    Posts
    17
    Well, it's pretty easy but these instructions assume you're using LVM2 and also have free space. The change won't be permanant on a LiveCD environment, but hope this gives you an idea:
    Do a vgdisplay -v to get the LogVol information, and also 'cat /proc/swaps' for the particular Logical Volume it's in. You can find out if you've further free space by either an 'sfdisk -l', 'fdisk -l', or 'vgdisplay -v'

    This instruction assumes that you're using VolGroup00/LogVol02:

    Unmount Swap:
    # swapoff -v /dev/VolGroup00/LogVol02
    Extend the LVM Logical Volume:
    # lvm lvresize /dev/VolGroup00/LogVol02 -L +256M
    OR (Either use ‘lvm lvresize’ OR ‘lvextend’ proceed with swap format after extend)
    lvextend -L 512M (or G) /dev/VolGroup00/LogVol02
    Format full Logical Volume as SWAP:
    # mkswap /dev/VolGroup00/LogVol02
    Enable Swap space:
    # swapon -va
    Testing swap space:
    # cat /proc/swaps
    # free -k

  6. #6
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3
    Thanks, I'll try it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •