Results 1 to 8 of 8

Thread: how to assign swap

  1. #1
    Join Date
    Apr 2011
    Location
    Florida, US
    Beans
    101
    Distro
    Ubuntu 12.04 Precise Pangolin

    how to assign swap

    ive been tryng to assign a swap partition for ubuntu. i have made the partition with a ive puppy linux cd. i cannot find any instructions that will explain to me how to assign that partition as my swap from ubuntu. i am sure this has been explained but any time i do a search on this site i get several irrelevant topics because swap is a very hot keyword for linux. please help.

    regards.

  2. #2
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,744

    Re: how to assign swap

    Quote Originally Posted by murderd2death View Post
    ive been tryng to assign a swap partition for ubuntu. i have made the partition with a ive puppy linux cd. i cannot find any instructions that will explain to me how to assign that partition as my swap from ubuntu. i am sure this has been explained but any time i do a search on this site i get several irrelevant topics because swap is a very hot keyword for linux. please help.

    regards.
    create the partition and choose swap as the filesystem. it should automatically mount is as /swap.

    however it depends on your system and memory as to whether you need it.

    You may want to look at a swapfile instead https://help.ubuntu.com/community/SwapFaq
    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  3. #3
    Join Date
    Sep 2011
    Beans
    1

    Re: how to assign swap

    There are a few steps that you need to follow.
    1. select the drive to partition it: sudo fdisk /dev/ydx where "y" could be an "h" for IDE hdd or "s" for sata/scsi/sas drives
    check the menu that the fdisk gives you, make sure to backup you data before doing any changes, and make a simple patition and change the partition ID to number 82
    2. command to chose the specific part as as swap fs: sudo mkswap /dev/sda1
    3. command to activate it: sudo swapon /dev/sda1
    4.command to verify if you have a swap part is: swapon -s
    That's it.

  4. #4
    Join Date
    Jul 2010
    Location
    /run/shm
    Beans
    820
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: how to assign swap

    ... or use GParted ("sudo apt-get install gparted" or use synaptic/Ubuntu software center to install it) and format the partition intended as swap. It should get mounted on every boot this way too.

  5. #5
    Join Date
    Apr 2011
    Location
    Florida, US
    Beans
    101
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to assign swap

    Quote Originally Posted by haqking View Post
    create the partition and choose swap as the filesystem. it should automatically mount is as /swap.

    however it depends on your system and memory as to whether you need it.

    You may want to look at a swapfile instead https://help.ubuntu.com/community/SwapFaq
    i accidentally formatted it as ext 4 instead of linux swap. solved it. thank you

  6. #6
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: how to assign swap

    add it to fstab, get it's UUID

    Code:
    sudo blkid |grep swap

    make note of the UUID

    Code:
    gksudo gedit /etc/fstab
    something like

    Code:
    UUID=longnumberfromblkid  none  swap  sw  0     0
    save and close gedit, you can

    Code:
    sudo swapon -a
    if necessary


    https://help.ubuntu.com/community/Fstab#Examples

  7. #7
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,744

    Re: how to assign swap

    Quote Originally Posted by murderd2death View Post
    i accidentally formatted it as ext 4 instead of linux swap. solved it. thank you
    no problems you are very welcome,

    Peace
    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  8. #8
    Join Date
    Feb 2009
    Beans
    15

    Re: how to assign swap

    Quote Originally Posted by Elfy View Post
    add it to fstab, get it's UUID

    Code:
    sudo blkid |grep swap

    make note of the UUID

    Code:
    gksudo gedit /etc/fstab
    something like

    Code:
    UUID=longnumberfromblkid  none  swap  sw  0     0
    save and close gedit, you can

    Code:
    sudo swapon -a
    if necessary


    https://help.ubuntu.com/community/Fstab#Examples
    Really thanks for this tips !!

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
  •