ciphermethod.com

Ubuntu Missing Swap

by on Dec.13, 2014, under Linux, Ubuntu


Fix missing swap on Ubuntu derivatives when using encrypted home directories:

$ swapon -s
Filename Type Size Used Priority

$ free
total used free shared buffers cached
Mem: 1010504 905892 104612 16964 14460 370292
-/+ buffers/cache: 521140 489364
Swap: 0 0 0

$ sudo -s
# fdisk -l | grep swap
..
Disk /dev/mapper/mint--vg-swap_1: 1069 MB, 1069547520 bytes
..

# mkswap /dev/mapper/mint--vg-swap_1 # copy UUID shown into next cmdline
mkswap: /dev/mapper/mint--vg-swap_1: warning: don't erase bootbits sectors
on whole disk. Use -f to force.
Setting up swapspace version 1, size = 1044476 KiB
no label, UUID=08109738-64e7-4504-8bfd-2dff2011551d
# echo "RESUME=UUID=143c43d8-0a77-4d62-a7ae-f53a8e0229a9" > /etc/initramfs-tools/conf.d/resume
# echo "cryptswap1 /dev/sdb3 /dev/urandom swap,cipher=aes-cbc-essiv:sha256" > /etc/crypttab
# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-3.13.0-24-generic
Warning: No support for locale: en_US.utf8

# swapon -s
Filename Type Size Used Priority
/dev/mapper/mint--vg-swap_1 partition 1044476 316 -1
# free
total used free shared buffers cached
Mem: 1010504 863964 146540 16984 12820 326476
-/+ buffers/cache: 524668 485836
Swap: 1044476 316 1044160

No comments for this entry yet...

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

But Wait, There's More!

A few highly recommended friends...