My system is freezing when the memory used is maxed out and I was wondering why. Turns out the swap is not being used. Here's my partition table:
Device Boot Start End Blocks Id System
/dev/sda1 * 63 80324 40131 de Dell Utility
/dev/sda4 81918 909195263 454556673 5 Extended
/dev/sda5 512121690 909195263 198536787 83 Linux
/dev/sda6 81920 3987455 1952768 83 Linux
/dev/sda7 3989504 140705791 68358144 83 Linux
/dev/sda8 492589056 512120831 9765888 82 Linux swap / Solaris
/dev/sda9 140707840 492584959 175938560 83 Linux
The swap partition is not turned on and doesn't show in df
but it does in the disks utility:
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 392M 1.3M 391M 1% /run
/dev/sda7 65G 19G 43G 31% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 26M 1.9G 2% /run/shm
none 100M 48K 100M 1% /run/user
/dev/sda6 1.9G 89M 1.7G 6% /boot
/dev/sda9 166G 47G 111G 30% /home
/home/my-user-name/.Private 166G 47G 111G 30% /home/my-user-name
$ sudo swapon -s
Filename Type Size Used Priority
As you can notice my Home partition is encrypted but I have not encrypted the swap.
Swap seems declared in /etc/fstab:
# swap was on /dev/sda8 during installation
#UUID=df55bf68-b824-4f21-83f3-dfa80a0b74ab none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
I'd like to know why it's not working and how can I fix it?
Update It seems there's a reported bug on this for several releases and has not been fixed for 14.04 yet.
Here's the result of cat /etc/crypttab
:
cryptswap1 UUID=df55bf68-b824-4f21-83f3-dfa80a0b74ab /dev/urandom swap,cipher=aes-cbc-essiv:sha256
And what was suggested by A.B.:
$ sudo /etc/init.d/cryptdisks reload
* Stopping remaining crypto disks... [ OK ]
* cryptswap1 (stopped)...
* Starting remaining crypto disks...
* cryptswap1 (skipped, device /dev/disk/by-uuid/df55bf68-b824-4f21-83f3-dfa80a0b74ab does not exist)... [fail]
[ OK ]
$ sudo swapon -a
swapon: /dev/mapper/cryptswap1: stat failed: No such file or directory
Based on David Foerster's answer I did cat /dev/disk/by-uuid/
and got 6 uuid's. Did blkid -U
of each and non is /dev/sda8
which the swap is supposed to be. I got sda's 1, 5, 6, 7, 9, and /dev/mapper/luks-****
. The last of which I think is the other encrypted partition that I left untouched during installation (was encrypted by 12.04).
I also tried the following answer. Did not work either.
Update: I ended up reformatting the partitions and re-installing the system. It seems working fine now.
cat /etc/crypttab
– A.B. Dec 28 '15 at 20:33sudo /etc/init.d/cryptdisks reload; swapon -a
– A.B. Dec 29 '15 at 15:59