Results 1 to 6 of 6

Thread: How can I enable a swap partition?

  1. #1
    Join Date
    Sep 2018
    Beans
    32

    How can I enable a swap partition?

    My hard drive is partitioned as follows:

    All partitions are primary partitions.
    I have Windows 10 and Ubuntu 18.04.1 LTS dual boot.
    I deleted Ubuntu swap file because I want use swap partition (that is listed above), but I don't know how to enable it (using free -m command I see that Ubuntu doesn't use the swap partition that I created).
    How can I do to enable this swap partition?
    If I use cat /etc/fstab on terminal the result is the following:

    Thank you in advance for your answers!!!
    Last edited by wildmanne39; September 5th, 2018 at 02:48 AM. Reason: Normalized Fonts

  2. #2
    Join Date
    Dec 2011
    Location
    Queens, New York
    Beans
    17
    Distro
    Ubuntu

    Re: How can I enable a swap partition?

    Try this tutorial, it is what I use to turn enable a swap partition: https://www.digitalocean.com/communi...n-ubuntu-18-04

  3. #3
    Join Date
    Feb 2008
    Location
    Texas
    Beans
    29,809
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How can I enable a swap partition?

    Please use the default font color and properties unless you need to highlight or draw attention to a part of your post.

  4. #4
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,822
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: How can I enable a swap partition?

    First find the UUID of the swap partition:
    Code:
    sudo blkid | grep 'TYPE="swap"'
    Then modify your /etc/fstab and replace /swapfile with UUID=xxx, using the UUID you got from the command above. The line that now has /swapfile must then look something like
    Code:
    UUID=01234567-89ab-cdef-0123-456789abcdef none            swap    sw              0       0
    The swap partition will be used after a reboot or running
    Code:
    sudo swapon -a

  5. #5
    Join Date
    Sep 2018
    Beans
    32

    Re: How can I enable a swap partition?

    Hi Impavidus, thank you very much for your answer!
    I used /dev/sda5 instead of UUID and it works!
    Is it ok anyway to use
    /dev/sda5 instead of UUID?

  6. #6
    Join Date
    Apr 2014
    Location
    Tucson AZ, USA
    Beans
    1,057
    Distro
    Ubuntu

    Re: How can I enable a swap partition?

    Depends on if you have other drives installed. What might be sda today may be sdb the net time you reboot. Uuids never change.

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
  •