0

I have Ubuntu 18.04.4, during installation I have created a 16GB swap partition. Everything worked fine until I have deleted it and created a new one because I needed that part of my disk. The new partition is never swapped on and I have to swap it on manually each time. Any ideas?

=========================================================

cat /etc/fstab output:

# swap was on /dev/sdb6 during installation

UUID=7a6bcacc-80cc-43ab-a6f9-bba2ad700fd0 none

=========================================================

lsblk -o NAME,LABEL,SIZE,FSTYPE,MOUNTPOINT,UUID output:

sda 465,8G

sda1 100M vfat /boot/efi 989D-9C4A

sda2 16M

sda3 135,8G ntfs 2ECCA154CCA1175D

sda4 18,6G ext4 47814b5c-274c-419a-9cd8-fde3747b7db5

sda5 954M ext4 /boot 8439bda4-aa66-4691-b91b-2c17a2077605

sda6 166,5G ext4 / d84635f0-058f-4756-9a44-9919896b2986

sda7 506M ntfs 6E6CE1CA6CE18D61

sda8 14,9G swap [SWAP] 94a8fc28-7164-44c2-abfa-1f0a3ce8eb4f

sda9 arch64 32,1G ext4 52dc9139-72f4-4eba-9d8b-a6f3190df6af

sda10 GAMES 96,3G ext4 /srv 604132ee-2976-4181-be11-e059fe5d96d6

=========================================================

4
  • 1
    What does cat /etc/fstab and lsblk -o NAME,LABEL,SIZE,FSTYPE,MOUNTPOINT,UUID show? Please add output to your question. Jul 31, 2020 at 20:26
  • 1
    Did you put the new entry (UUID or /dev/XXX) for the new swap partition in /etc/fstab?
    – WU-TANG
    Jul 31, 2020 at 20:41
  • @WU-TANG no I haven't, how do I do that?
    – xzy54
    Jul 31, 2020 at 21:01
  • 1
    Update /etc/fstab with new UID for swap: 94a8fc28-7164-44c2-abfa-1f0a3ce8eb4f
    – vanadium
    Jul 31, 2020 at 21:36

1 Answer 1

0

You've changed the swap partition, and thus its UUID. That must be reflected in the file /etc/fstab:

Open a terminal and type

sudo nano /etc/fstab

Search for a line that looks like this:

UUID=7a6bcacc-80cc-43ab-a6f9-bba2ad700fd0  none  swap       sw       0       0

Replace that number after UUID with 94a8fc28-7164-44c2-abfa-1f0a3ce8eb4fso it looks like this:

UUID=94a8fc28-7164-44c2-abfa-1f0a3ce8eb4f  none  swap       sw       0       0

Save it by using CRTL+X and reboot. If you've enabled hibernate, grub needs the actual resume uuid as well.

2
  • Your swap line is incorrect. See my answer for the correct line.
    – heynnema
    Jul 31, 2020 at 22:51
  • Well, you are right. Thanks for the tip. I'll update my answer - still my swap works...
    – kanehekili
    Aug 1, 2020 at 18:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .