Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Ubuntu doesn't recognize my swap partition

  1. #11
    Join Date
    Nov 2010
    Beans
    241

    Re: Ubuntu doesn't recognize my swap partition

    First run mkswap on it. Like this
    Code:
    mkswap /dev/sdX
    Then let your Linux know you want to use it with swapon. Like this
    Code:
    swapon /dev/sdX
    That's it, repeat it for every swap partition you have.
    Of course, if you want them activated automatically next reboot add respective lines to your fstab.
    You can also turn them off with swapoff. Like this
    Code:
    swapoff /dev/sdX
    Note, activating and deactivating swap does not require reboot, as with everything else in Linux (except kernel upgrade).

  2. #12
    Join Date
    Nov 2010
    Beans
    241

    Re: Ubuntu doesn't recognize my swap partition

    Just to illustrate the fun working with Linux.

    Once upon time I was building Openoffice on Gentoo, the box had not much resources, I think it had 1 GiB of RAM and 512 MiB of swap. I had conky running on the desktop and I saw memory filled up and swap filling up, too. Compiling Openoffice is time consuming, I did not want it to be killed by OOM killer.
    I quickly did
    Code:
    dd if=/dev/zero of=/swapfile bs=1024 count=1M
    this created 1 gigabyte file, then I made it swap space
    Code:
    mkswap /swapfile
    and finally I activated it
    Code:
    swapon /swapfile
    and voila! My compilation process was saved.

  3. #13
    Join Date
    Aug 2011
    Beans
    248
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Ubuntu doesn't recognize my swap partition

    So if I were to want to add another partition to swap permanently, all I would do is to add another line that says the bellow to the fstab?

    Code:
    "name of partition" swap
    Last edited by bobman321123; January 11th, 2012 at 02:51 AM. Reason: To clarify

  4. #14
    Join Date
    Nov 2010
    Beans
    241

    Re: Ubuntu doesn't recognize my swap partition

    Look at existing line for swap in /etc/fstab. There are a few fields to be filled.

    1. device
    2. mount point
    3. type
    4. mount options

    See man fstab for more.

  5. #15
    Join Date
    Aug 2011
    Beans
    248
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Ubuntu doesn't recognize my swap partition

    Ok, Thanks man.

  6. #16
    Join Date
    Aug 2011
    Beans
    248
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Ubuntu doesn't recognize my swap partition

    Thanks for the help everyone, I don't know how I would survive without you guys.

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •