Hibernating causes data loss
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kubuntu-settings (Ubuntu) |
Invalid
|
Medium
|
Unassigned |
Bug Description
What happens:
Every time my laptop attempts to hibernate on my Lenovo W510, I lose data. I am using home partition encryption (pretty sure this is the cause).
100% of the time, one of the files that becomes unreadable is ~/.kde/
"~/.kde/
I get that error when I try to do anything but rm -rf the broken file.
If I do an ls -l on the file, the output is as follows:
"-rw------- 1 jessie jessie 0 Jun 12 23:38 /home/jessie/
Notice the file size is 0. The modified date is almost exactly when my laptop last attempted to hibernate.
This happens EVERY time I try to hibernate.
This causes me to lose data, I hate that.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: cryptsetup 2:1.4.1-2ubuntu4
ProcVersionSign
Uname: Linux 3.2.0-24-generic x86_64
NonfreeKernelMo
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
Date: Wed Jun 13 09:09:23 2012
EcryptfsInUse: Yes
InstallationMedia: Kubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120228.1)
ProcEnviron:
LANGUAGE=
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: cryptsetup
UpgradeStatus: No upgrade log present (probably fresh install)
crypttab:
# <target name> <source device> <key file> <options>
cryptswap1 /dev/sda7 /dev/urandom swap,cipher=
affects: | ubuntu → cryptsetup (Ubuntu) |
affects: | kubuntu-default-settings (Ubuntu) → kubuntu-settings (Ubuntu) |
Your /etc/crypttab shows that you have random crypted swap configured. It is impossible to resume from hibernate from a random-encrypted swap device because, by definition, the key is not stored anywhere that it can be used for resuming from a cold boot. This is one of many reasons why hibernate is disabled on Ubuntu by default. If Kubuntu is giving you the option to hibernate, that's a bug in the Kubuntu GUI.
If you want to be able to hibernate, you will need to reconfigure your encrypted swap to use a fixed key instead of a random one. This will require you to enter a passphrase at boot (and at resume from hibernate). Use of unencrypted swap with encrypted home directories is strongly discouraged as insecure.