I'm trying to enable hibernation on my laptop, a Dell XPS-13 (with a 256 GB SSD mounted as an encrypted volume).

I was following the official documentation here and I attempted the "hibernation test" by executing sudo pm-hibernate from a command prompt. Needless to say it failed, in the sense that the screen went dark for a few seconds and then everything resumed as-was. The documentation mentioned checking whether the swap partition in "at least as large as available RAM" (in my case, 8 GB).

So I typed df and this is what I saw (I've made extensive use of tmps in my /etc/fstab to avoid needless grind on the SSD):

user@host:~$ df
Filesystem                  1K-blocks     Used Available Use% Mounted on
/dev/mapper/ubuntu--vg-root 237978256 14144120 211722472   7% /
none                                4        0         4   0% /sys/fs/cgroup
udev                          3829132        4   3829128   1% /dev
tmpfs                         3844736     2060   3842676   1% /tmp
tmpfs                          768948     1324    767624   1% /run
none                             5120        0      5120   0% /run/lock
none                          3844736    32312   3812424   1% /run/shm
none                           102400       28    102372   1% /run/user    
tmpfs                         3844736        0   3844736   0% /var/spool
tmpfs                         3844736       24   3844712   1% /var/tmp
tmpfs                         3844736      936   3843800   1% /var/log
/dev/sda1                      240972    84550    143981  37% /boot
/home/user/.Private        237978256 14144120 211722472   7%  /home/user

Am I right in my diagnosis that I have no swap partition at all??

(I have vm.swappiness set to 0, if I remember correctly, in case that's relevant in any way.)

If I'm right in my diagnosis, how do I go about creating one at this late moment in time?

1 Answer 1


Searching the internet helped me discover that sudo swapon -s will report whether a swapfile is active or not, and if so, where it is. It turns out that as I suspected I don't have one active, which is pretty surprising but explains a lot of things.

Now I will follow the procedure indicated here to enable one.

  • As a general rule, do web searches before you post on the forum :).
    – Moose
    May 17, 2014 at 14:45
  • 1
    You won't be able to hibernate with a swap file. You will need a swap partition. See askubuntu.com/questions/33697/… on how to create one.
    – Takkat
    May 17, 2014 at 15:41
  • Thanks for pointing that out. Indeed I was wondering whether I could get off easily by creating myself a swapfile, but you pre-empted that. The dilemma I'm facing now is whether to create the swap partition within the LUKS volume or alongside it.
    – qubex
    May 17, 2014 at 18:34

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.