The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resizing SWAP on cPanel server

Discussion in 'Workarounds and Optimization' started by postcd, Oct 11, 2011.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    I have used this guide to resize swap:

    cp -rfp /tmp /home/tempdel
    umount -l /tmp
    rm -rf /usr/tmpDSK
    pico /scripts/securetmp find: my $tmpdsksize = 512000; # Must be larger than 250000; and changed value.
    /scripts/securetmp
    reboot

    Result:
    /dev/loop0 /tmp 2% (17,680 of 1,007,896)
    Swap Used 0% (0 of 523,260)

    But why its still SWAP on 512MB please? How can i change it?
     
  2. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    What you've used is for tmp resizing not SWAP.

    To resize it if you are using LVM:

    #To turn it off
    PHP:
    swapoff -/dev/VolGroup18/SWAP
    #Change VolGroup18 to what you've



    #To Resize it
    PHP:
    lvm lvresize /dev/VolGroup18/SWAP -+512M
    #This will increase the size by 512MB "Change it to what you need"
    #Change VolGroup18 to what you've



    #To Create it
    PHP:
    mkswap /dev/VolGroup18/SWAP
    #Change VolGroup18 to what you've



    #To make it back on
    PHP:
    swapon -va


    #To check for new size
    PHP:
    df -h
    Done.
     
Loading...

Share This Page