Results 1 to 3 of 3

Thread: Creating SWAP partition after Linux Installed

  1. #1
    Join Date
    Mar 2006
    Location
    Louisiana
    Beans
    24
    Distro
    Ubuntu 9.10 Karmic Koala

    Question Creating SWAP partition after Linux Installed

    I didn't create a swap partition when I first installed linux, if I re-size a not really used up partition "not the partion i installed linux" and format it as a swap partition.

    Will my linux os auto-detect the swap partion and use it? Or do I have to enter some commands in terminal?

    I'm a newbie, Help me out.

    Using Jaunty

  2. #2
    Join Date
    Feb 2007
    Location
    Maryland, USA
    Beans
    3,396
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Creating SWAP partition after Linux Installed

    I don't think linux will auto-detect a new swap partiton, but it is easy to inform it of the change.

    Once you have an installed system, you will need to create a new partition, and alter your /etc/fstab file to make it use the partition at boot time. You can make a partition with any partition editor. I like gparted, and use the gparted live CD. I don't think you need to format the partition. If you can, designate it as "use for swap", but if you can't, don't worry about it.

    Once you create the partition, you can inform your system to use it this way. Say you created /dev/sda3 to use as swap. Try these commands:
    Code:
    sudo mkswap /dev/sda3
    sudo swapon /dev/sda3
    That makes the partition active as swap space on your running system.

    To make it use the new partition as swap space on reboot, edit your /etc/fstab file. To use gedit in the graphical user space, get a command line with alt-F2. Then enter the command
    Code:
    gksudo gedit /etc/fstab
    Add to the file this line:
    Code:
    /dev/sda3  none swap  sw  0 0
    Save the file, close the editor and reboot. Once you have used some programs, check to see if swap is being used with the free command. Here is a nice reference about swap.
    Last edited by dstew; September 10th, 2009 at 05:27 PM.

  3. #3
    Join Date
    Mar 2006
    Location
    Louisiana
    Beans
    24
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Creating SWAP partition after Linux Installed

    thanks a lot for your help dstew

    I will try this when I get home from work

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
  •