full circle magazine #65
15
HOWTO - ADD ENCRYP T ION
you can press Alt-F2 and enter
gksudo gedit), edit the file
/etc/crypttab. Replace the existing
cryptswap1 line as follows
(remember to replace /dev/sdXN
with your swap device).
cryptswap1 /dev/sdXN none
luks
Now edit the file
/usr/share/initramfs-
tools/scripts/local-top/cryptroot.
Search for the following line
(which should be on line 288, but
that could change over time):
message "cryptsetup: unknown
error setting up device
mapping"
Skip to the next blank line
(before FSTYPE='') and insert a
new line (remember to replace
/dev/sdXN):
/sbin/cryptsetup luksOpen
/dev/sdXN cryptswap1
Edit the file
/etc/acpi/hibernate.sh. At the first
blank line, insert the following line.
DEVICE='/dev/mapper/cry p t s w a p
1'
Edit the file /etc/initramfs-
tools/conf.d/resume. Replace the
existing line with:
RESUME=/dev/mapper/cryp t s w a p 1
Edit the file /etc/polkit-
1/localauthority/50-
local.d/com.ubuntu.enable-
hibernate.pkla. The file does not
already exist, so you’ll be creating
it. Add the following lines.
[Re-enable hibernate by
default]
Identity=unix-user:*
Action=org.freedesktop. u p o w e r
.hibernate
ResultActive=yes
Finally, open a terminal and
enter the following command.
sudo update-initramfs -u -k
all
Reboot.
Using Hibernation
When starting, your machine
will prompt you for your new swap
passphrase. Enter it, and you
should continue to a normal login.
If you forget the passphrase,
enter anything. After three failed
attempts, the machine will
continue any way, but with the
swap disabled. Redo this how-to to
reset your passphrase.
Now, you will find Hibernate on
your shutdown menu, and you can
hibernate! If you wish to hibernate
from the CLI (command line
interface), use the command:
sudo pm-hibernate