Results 1 to 8 of 8

Thread: increase swap space

  1. #1
    Join Date
    Sep 2008
    Beans
    103

    Angry increase swap space

    i checked my swap space using top command and it showed
    Swap: 0k total, 0k used, 0k free, 391396k cached

    how to increase swap space?
    thanks

  2. #2
    Join Date
    Dec 2008
    Location
    /home/red
    Beans
    134

    Re: increase swap space

    Code:
    sudo apt-get install gparted
    Then run terminal and run this command:
    Code:
    sudo gparted
    Then you can change it within there.
    Linux User |494633|
    lspci? What's that mean? Internet space personal computer internet?

  3. #3
    Join Date
    May 2009
    Location
    Canada
    Beans
    1,204
    Distro
    Ubuntu

    Re: increase swap space

    You can use the installer to resize partitions. You can use the live cd. You cannot change the start of a partition, just the end. You need to shrink the partition which comes before it, delete the swap and recreate it beginning at the newly created space.

    so right now you have no swap at all

    goood luck
    Last edited by philcamlin; August 17th, 2009 at 06:45 PM.

  4. #4
    Join Date
    Sep 2008
    Beans
    103

    Angry Re: increase swap space

    Quote Originally Posted by rednano12 View Post
    Code:
    sudo apt-get install gparted
    Then run terminal and run this command:
    Code:
    sudo gparted
    Then you can change it within there.
    i have gparted
    do i have to format a partition ?
    Last edited by gkraju; August 17th, 2009 at 06:54 PM.

  5. #5
    Join Date
    Feb 2008
    Location
    Greenville, SC USA
    Beans
    182
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: increase swap space

    If you have a partition you can use right off you can use the mkswap command to make a "swap filesystem" in the space.

    From there if you want to test it, you can mount the space using the swapon command. Dont forget to put it in your /etc/fstab file so it will persist a reboot.

  6. #6
    Join Date
    Apr 2008
    Beans
    11,707

    Re: increase swap space

    You'll need to use gparted (aka: partition editor) from the Live CD as all partitions must be unmounted to resize or move them. You'll also need to select "swapoff" on the swap partition.

    Note: after moving or resizing swap you'll almost cetainly end up in UUID hell - you'll likely lose the "quiet usplash" and the "persistance" of swapon at reboot.

    Give me a few minutes and I'll post the uuid fix here also.

  7. #7
    Join Date
    Mar 2007
    Beans
    763

    Re: increase swap space

    just thought I would add that the following command is useful for seeing which swapfiles are currently being used:
    Code:
    cat /proc/swaps

  8. #8
    Join Date
    Apr 2008
    Beans
    11,707

    Re: increase swap space

    Assuming you are successful with the partitioning and now just need to straighten out the UUID problems from recreating or resizing SWAP.

    We'll be working from terminal:

    Code:
    sudo blkid -c /dev/null

    That will display something like this:

    /dev/sda1: UUID="5A3CAE183CADEEE7" TYPE="ntfs"
    /dev/sda5: UUID="3f6a93da-cbc0-4203-92ce-42ff70394f0a" TYPE="ext3"
    /dev/sda6: TYPE="swap" UUID="5b397135-2a82-4933-aefd-00d7ff23b413"
    /dev/sda7: UUID="cb8d8925-8059-46bc-8312-9ce5f42afa91" SEC_TYPE="ext2" TYPE="ext3"

    The UUID #'s are in parenthesis. DO NOT include the parenthesis when you replace the UUID's in the following files! BTW the "-c /dev/null" is necessary because if you run blkid without options it reads from its cache file. If you've run it before and any partition has changed you'll get erroneous results.

    Now:

    Code:
    cat /etc/fstab
    You'll undoubtedly see that the UUID's for SWAP are different. Here I like to create a simple backup of the original /etc/fstab using copy-n-paste and either Abiword or Open Office so if I hose things I can put things back in their original state! Do NOT be concerned at this point if the partition #'s are different! DO NOT change a partition #! Change nothing but UUID's!

    To edit that file:

    Code:
    gksudo gedit /etc/fstab
    It's much, much easier to cut- copy-n-paste! Just be careful! And when you're done editing remember to click on Save, then go to File > Quit!

    Now on to /etc/initramfs! Run:

    Code:
    cat /etc/initramfs-tools/conf.d/resume
    That UUID should (but won't) match the UUID for SWAP in blkid so to edit:

    Code:
    gksudo gedit /etc/initramfs-tools/conf.d/resume

    Again be sure to save > file > quit! Now one last important thing:

    In terminal:

    Code:
    sudo update-initramfs -u
    Be patient! It takes a minute or two to run! Wait until the command prompt (like lance@lance-desktop) shows up again!

    You should now have "persistent" swap and a quiet usplash.

Bookmarks

Posting Permissions

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