swapon: /swapfile: read swap header failed

Asked by Chiranjeev Das on 2017-10-15

Computer takes a long time to startup, followed by a command line saying: Failed to activate swap /swapfile.

systemctl status swapfile.swap gives:

● swapfile.swap - /swapfile
 Loaded: loaded (/etc/fstab; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2017-10-16 03:17:27 IST; 8min ago
     What: /swapfile
      Docs: man:fstab(5)
                  man:systemd-fstab-generator(8)

>Oct 16 03:17:27 Chiranjeev-MacBuntu systemd[1]: Activating swap /swapfile...
>Oct 16 03:17:27 Chiranjeev-MacBuntu swapon[1234]: swapon: /swapfile: read swap header failed
>Oct 16 03:17:27 Chiranjeev-MacBuntu systemd[1]: swapfile.swap: Swap process exited, code=exited status=255
>Oct 16 03:17:27 Chiranjeev-MacBuntu systemd[1]: Failed to activate swap /swapfile.
>Oct 16 03:17:27 Chiranjeev-MacBuntu systemd[1]: swapfile.swap: Unit entered failed state.

I logged in with a live USB and created a awap partition 2048 Mb in size, still same issue.

Heres my fstab:

# /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=d28ab1ef-48d6-42a9-9ec4-b365a6bf119d / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=5071-9310 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0

I've seen similar issues in other forums, but there it said the issue was fixed and patches released. I updated the system, issue persists.

What exact steps so I take to solve this?

Question information

Language:
English Edit question
Status:
Solved
For:
budgie-remix Edit question
Assignee:
No assignee Edit question
Solved by:
fossfreedom
Solved:
2017-10-15
Last query:
2017-10-15
Last reply:
2017-10-15
Best fossfreedom (fossfreedom) said : #1

This is fixed in 17.10

17.10 (stable) isnt released yet right?

How do I fix it in .04

fossfreedom (fossfreedom) said : #3

Canonical need to backport the fix - it is being tracked here https://bugs.launchpad.net/ecryptfs/+bug/1670336

17.10 will go stable on thursday.

Thanks fossfreedom, that solved my question.