Results 1 to 6 of 6

Thread: Missing SWAP partition

  1. #1
    Join Date
    May 2006
    Beans
    56

    Question Missing SWAP partition

    Hi,

    I have a (live) ubuntu 6.10 server. The server is configured with RAID1 (mirrored drives) holding two data partitions; however there appears to be no SWAP partition. How do I create a SWAP partition, and add it in so that it is used?

  2. #2
    Join Date
    Aug 2005
    Beans
    53

    Re: Missing SWAP partition

    you have to create a partition with the required space
    add a line to /etc/fstab
    ie (/dev/sda2 none swap sw 0 0)
    then use swapon during boot to turn it on (see man swapon)

    this has been for how long with no noticable effect

  3. #3
    Join Date
    Apr 2008
    Location
    Carlisle, MA
    Beans
    71
    Distro
    Ubuntu 10.04 Lucid Lynx

    Lightbulb Re: Missing SWAP partition

    You can also use a file through a loop back device. I do not know what if any performance issues there would be from this quick and safe solution.
    It would need to "mount" via swapon after the file system containing the file is mounted. You can achieve this by setting appropriate numbers in /etc/fstab.

    Detailed instructions on adding a swap file are in the community docs:
    https://help.ubuntu.com/community/SwapFaq

  4. #4
    Join Date
    May 2006
    Beans
    56

    Re: Missing SWAP partition

    Thanks drave & zarthon,

    I'll be creating a swap partition.
    Working from your advised reading, the process is:

    create partition;
    add pointer to new swap partition in /etc/fstab, something like:
    /dev/mda8 none swap sw 0 0
    re-boot;
    create swap and enable it:
    /sbin/mkswap /dev/mda8
    swapon -a
    If there's any obvious slip-ups there please let me know.
    I'm assuming the swapon only has to be issued once, not after every re-boot. Is this correct, or do I need to add something else?

    drave wrote:
    this has been for how long with no noticable effect
    I don't know drave, as the server's new to me; but I'm having to replace the drives (out of space), and it seemed a sensible time to add a swap partition.

  5. #5
    Join Date
    May 2009
    Beans
    51
    Distro
    Xubuntu 9.10 Karmic Koala

    Re: Missing SWAP partition

    Again - thanks to all who solve things on this forum. For some reason Installing Windows on a second hard drive damaged the swap file on my linux hard disk and I needed to repair it. You're advice was 100%

    Conky turned out to be a good desktop app too, BTW. It's what told me my swap was gone. Had no reason to know it was, since with Xubuntu I never go over 80% of my 368MB *cough* of RAM.

    Y'all rule.

  6. #6
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Missing SWAP partition

    Conky is good. It tells me that even though I have 3GB swap space I rarely if ever use more than about 10 MB. But I believe it's useful for hibernating, which I never seem to use.

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
  •