HOW TO: Disable SWAP and regain 1 GB from your SSD

Discussion in 'Linux' started by janss, Aug 15, 2008.

Thread Status:
Not open for further replies.
  1. janss

    janss

    Joined:
    Jul 23, 2008
    Messages:
    220
    Likes Received:
    0
    I decided to make this a How To so people can find it more easily. Direct copy-paste of my post from the RAM upgrade -thread.

    Disabling the swap itself is done by giving the command (as root naturallu)

    Code:
    swapoff /dev/sda2
    You can check which partition your swap is (mine was sda2) by commanding

    Code:
    fdisk -l
    The swapoff command only disables the swap, so then you can "test drive" your system for a while to see if you run in to any problems. The /etc/fstab file is configured to automatically assign swap on each boot-up, to disable this, just open the /etc/fstab -file and comment the swap-line to look like this:

    Code:
    #/dev/sda2          swap               swap         defaults               0 0
    If you want to remove the swap partition and merge the 1 gig with your sda1 (main partition) you need to remove the sda2 partition and resize sda1.

    For this I used System Rescue CD installed on a usb-drive. It is basically a Linux distro that can be run from a cd or usb-stick and comes pre-installed with a bunch of usefol tools to tweak and recover a computer system, in this case the useful part was GParted. You need to start the system to something else than Linpus because these programs can't resize an active partition (as in partition the system is running on currently)

    After you've booted to sysresccd, just type 'startx' to start graphics and then type 'gparted' to start the partitioner.
    Delete the swap-partition and resize the main partition to full capasity and that's it. :geek:

    Hope this clarifies things a bit.

    And a word of caution: Every time you mess with the partition table you risk data-loss and system malfunction. If you don't know what you are doing, don't do it.

    And also, DO NOT DISABLE SWAP IF YOU ARE RUNNING A SYSTEM WITH THE BASIC 512 MB RAM! (It will work with 512 MB RAM to some extend, but if you plan to "heavy-use" your One or multitask alot you might run in to problems with the basic memory.)

    My One has been on all day and I installed a bunch of software, have multiple programs on at a time and I still have 199 megs of RAM free, so in basic use this system is perfectly capable of runnig without swap if you upgrade to 1,5 gig RAM.
     
    janss, Aug 15, 2008
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Thread Status:
Not open for further replies.