4

My swap partition is neither mounted nor active. My system does find/recognise the swap partition but that is it

My fstab entries:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=13d93751-743e-49f4-9cd4-681aeaa2ba30 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=8CB4-46F0  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sda4 during installation
# swap was on /dev/sda3 during installation
#UUID=5b41eeb7-0447-491e-b0ce-8f3d35280ea2 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0
#PARTUUID=778e6277-6364-11e3-9faa-0c54a54d3e5a
 /media/ntfs -ntfs-3g ntfs defaults,umask=222  0 0

I have inserted the last UUID manually into the fstab to access an external NTFS disk. Could that be the issue?

As requested here is my crypttab:

cryptswap1 UUID=5b41eeb7-0447-491e-b0ce-8f3d35280ea2 /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

And here my lsblk -f

NAME           FSTYPE LABEL UUID                                 MOUNTPOINT
sr0                                                              
sda                                                              
├─sda4         ext4         0d497413-33f4-4147-83e1-158673893393 /home
├─sda2         ext4         13d93751-743e-49f4-9cd4-681aeaa2ba30 /
├─sda3         swap         5b41eeb7-0447-491e-b0ce-8f3d35280ea2 
│ └─cryptswap1 swap         4cd2e69a-b27e-41e1-9250-3d2e65ebbf11 [SWAP]
└─sda1         vfat         8CB4-46F0                            /boot/efi

The command sudo swapon -a does not give me any output at all!

The command ls -lA /dev/mapper shows

control
cryptswap1

The command swapon shows

NAME      TYPE      SIZE USED PRIO
/dev/dm-0 partition 3,9G   0B   -1

Output of systemctl status systemd-cryptsetup@cryptswap1.service

● systemd-cryptsetup@cryptswap1.service - Cryptography Setup for cryptswap1
   Loaded: loaded (/etc/crypttab; bad; vendor preset: enabled)
   Active: active (exited) since Sa 2016-12-24 10:37:43 CET; 36min ago
     Docs: man:crypttab(5)
           man:systemd-cryptsetup-generator(8)
           man:systemd-cryptsetup@.service(8)
  Process: 919 ExecStartPost=/sbin/mkswap /dev/mapper/cryptswap1 (code=exited, status=0/SUCCESS)
  Process: 702 ExecStart=/lib/systemd/systemd-cryptsetup attach cryptswap1 /dev/disk/by-uuid/5b41eeb7-0447-491e-b0ce-8f3d35280ea2 /dev/urandom swap,offset=1024,cipher=aes-xts-plain64 (code=exited, status=0/SUCCESS)
 Main PID: 702 (code=exited, status=0/SUCCESS)

Dez 24 10:37:37 dirksson-SATELLITE-PRO-C50-A-1J1 systemd[1]: Starting Cryptography Setup for cryptswap1...
Dez 24 10:37:38 dirksson-SATELLITE-PRO-C50-A-1J1 systemd-cryptsetup[702]: Set cipher aes, mode xts-plain64, key size 256 bits for device /dev/disk/by-uuid/5b41eeb7-0447-491e-b0ce-8f3d35280ea2.
Dez 24 10:37:43 dirksson-SATELLITE-PRO-C50-A-1J1 mkswap[919]: Setting up swapspace version 1, size = 3,9 GiB (4163366912 bytes)
Dez 24 10:37:43 dirksson-SATELLITE-PRO-C50-A-1J1 mkswap[919]: no label, UUID=eb58cf21-d0aa-41c2-bd86-a81466328f93
Dez 24 10:37:43 dirksson-SATELLITE-PRO-C50-A-1J1 systemd[1]: Started Cryptography Setup for cryptswap1.

free -h shows

              total        used        free      shared  buff/cache   available
Mem:           3,7G        975M        1,7G        108M        1,0G        2,4G
Swap:          3,9G          0B        3,9G

swapon -h shows no entry for cryptswap

/dev/sda3                               partition   4066300 0   -2
  • You've got a cryptswap. Can you please [edit] your question and add the content of /etc/crypttab? – Byte Commander Dec 23 '16 at 22:50
  • 2
    Okay, looks good so far. What does lsblk -f show? What does ls -lA /dev/mapper show? What does sudo swapon -a output? Oh, and please leave me a comment with "@ByteCommander" so that I get notified once you have edited and updated your question. – Byte Commander Dec 23 '16 at 23:16
  • 1
    I remember problems with cryptswap in previous versions of Ubuntu. But the current 16.04.1 LTS should work well. Which version are you running? – sudodus Dec 24 '16 at 03:50
  • I still can not see a problem, unfortunately. However, I believe sudo swapon -a should have printed an error message if it was unable to turn on the configured swaps. The virtual crypt disk is also there. Can you please run plain swapon and recheck whether the swap is really not activated? Also please show the output of systemctl status systemd-cryptsetup@cryptswap1.service | cat. Have you rebooted since setting the swap up or doing the last changes? If not, do that. – Byte Commander Dec 24 '16 at 09:57
  • @ByteCommander yes I have rebooted but no change... – user634299 Dec 24 '16 at 10:17
  • Sorry, to me it looks like it works. What does free -h tell you? – Byte Commander Dec 24 '16 at 10:32
  • @ByteCommander updated! – user634299 Dec 24 '16 at 10:47
  • 1
    Your swap is working just fine. What do you want?? I'm voting to close this question as not reproducible. – Byte Commander Dec 24 '16 at 13:45
  • 1
    Does swapon -s show an entry for /dev/mapper/cryptswap? If not, what does it show instead? – David Foerster Dec 24 '16 at 15:14
  • @ByteCommander ok maybe it just looked like it doesnt... I am a newbie.. – user634299 Dec 25 '16 at 09:07
  • @DavidFoerster I have updated the info, David. – user634299 Dec 25 '16 at 09:07
  • 1
    The various file and command listings are quite inconsistent and suggest that something (probably you assuming an at least moderately sane system setup) changed the swap configuration in between them. Could you please 1) reboot your system, 2) re-run all of the commands and 3) replace the old listings in your question with their new versions so we might come to a conclusion based on consistent facts? Thanks. – David Foerster Dec 25 '16 at 10:20
  • @DavidFoerster is right, the last output of swapon -h (although at least my swapon does not have a -h option, no idea what that's supposed to do or why it works at all) is not consistent with the stuff you showed us before and says that you're using /dev/sda3 as raw swap partition and not as encrypted one. I reopened the question. As David said, please reboot and rerun all the commands and update the outputs in your question, then notify us with a comment when you're done. Thanks. – Byte Commander Dec 25 '16 at 12:09

0 Answers0