I used a live USB to increase the size allocated to Ubuntu. Now I am on my OS. I increased the swap from 8 GB to 11 GB, but now I can't see it is used.

$ sudo lsblk              
[sudo] password for caner: 
sdb      8:16   1   7.5G  0 disk 
└─sdb1   8:17   1   7.5G  0 part /media/caner/UBUNTU 16_0
sda      8:0    0 238.5G  0 disk 
├─sda2   8:2    0 222.3G  0 part /
├─sda3   8:3    0    11G  0 part 
└─sda1   8:1    0   512M  0 part /boot/efi

$ free -m          
              total        used        free      shared  buff/cache   available
Mem:           7834        5452         245          80        2136        1949

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           784M  9.4M  775M   2% /run
/dev/sda2       219G   25G  183G  13% /
tmpfs           3.9G   30M  3.8G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1       511M   13M  499M   3% /boot/efi
tmpfs           784M   60K  784M   1% /run/user/1000
/dev/sdb1       7.5G  1.6G  6.0G  21% /media/caner/UBUNTU 16_0

$ sudo blkid
/dev/sda1: UUID="32F0-543D" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="16b2efe3-e142-4d6e-bc0a-22fc9dff9d73"
/dev/sda2: UUID="a18cf8e7-12f8-40df-9e3b-2f0605c6f661" TYPE="ext4" PARTUUID="ffeeec5b-943a-4d86-9836-e1be818b1669"
/dev/sda3: UUID="9c1fc3a8-ef4a-451a-9e8f-7f07dc18db8d" TYPE="swap" PARTLABEL="linux-swap" PARTUUID="848d50d8-c99d-45c6-83db-d8268eef3871"
/dev/sdb1: LABEL="UBUNTU 16_0" UUID="ECC1-9477" TYPE="vfat" PARTUUID="001c3909-01"

$ cat /etc/fstab
# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=a18cf8e7-12f8-40df-9e3b-2f0605c6f661 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
#UUID=32F0-543D  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda3 during installation
UUID=f4bb47fb-7475-44ba-9e20-b8f931b22c9b none            swap    sw              0       0
UUID=32F0-543D  /boot/efi       vfat    defaults        0       1

I don't want to do anything because I broke my previous system recently so I don't want to do it again.

While on the system, if I use GParted and click my 11GB area for "swap on" and after I close GParted I see swap is 11 GB:

$ top                                                                                                                                                 ✭ ✈ ✱
top - 13:52:43 up 4 min,  2 users,  load average: 4.80, 3.19, 1.29
Tasks: 287 total,   1 running, 227 sleeping,   0 stopped,   0 zombie
%Cpu(s): 41.7 us,  3.7 sy,  0.0 ni, 54.4 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem :  8022928 total,   220828 free,  5531752 used,  2270348 buff/cache
KiB Swap: 11534332 total, 11534332 free,        0 used.  2061940 avail Mem

But if I restart it goes and And it takes a lot of time to open Ubuntu.

What can I do?

  • I did this and now it seems work askubuntu.com/questions/194775/… but still it takes long time. – vegan Sep 9 '18 at 11:02
  • If i hibernate and wake up, it starts a new ubuntu. Not brings mine hibernated. – vegan Sep 9 '18 at 11:06
  • Please also provide the output of "sudo blkid". This will reveal if UUID in fstab is correct or not. – vanadium Sep 9 '18 at 11:36
  • I stand corrected: you already did. Yes, there is a mismatch. – vanadium Sep 9 '18 at 12:14
  • What about hibernate problem? – vegan Sep 9 '18 at 22:48

Your swap partition is not being used because it is not correctly announced in your configuration file /etc/fstab. Your swap file is /dev/sda3 with UUID "9c1fc3a8-ef4a-451a-9e8f-7f07dc18db8d". The reference to it in your fstab file is broken, because it still lists the UUID before the change.

To solve the issue, edit your fstab file. I provide instructions that may or may not be too detailed for you depending on your experience.

  1. Open your /etc/fstab configuration file as root for editing:

    sudo nano /etc/fstab
  2. In the line for swap, replace the existing UUID by the correct one, i.e., the one provided by the sudo blkid command. Replace:

    UUID=f4bb47fb-7475-44ba-9e20-b8f931b22c9b none    swap    sw     0       0


    UUID=9c1fc3a8-ef4a-451a-9e8f-7f07dc18db8d none   swap    sw     0       0

    (only the UUID number is being changed here.

  3. Save the file and exit. Press Ctrl+S (this saves) then Ctrl+X (this exits nano)

You can quickly check if all is good without rebooting:

sudo mount -a

This re-executes the fstab file. There shouldbe no output from this command. Any output indicates an error. If there is no output, verify whether your swap is active

free -m


swapon -s

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.