Have a strange issue where suddenly all my swapfile (1gb each) get truncated to only use 60k . I can remove/recreate etc but whatever i do , the max seems limited to 60k with following message in syslog:
Truncating oversized swap area, only using 60k out of 1048572k
kernel: [ 406.348815] Adding 60k swap on /mnt/swapfile. Priority:-1 extents:1 across:60k FS
No difference if i use partition or file.
procedure used to create new swaps :
> dd if=/dev/zero of=/swapfile bs=1M count=1000
> mkswap /swapfile
Setting up swapspace version 1, size = 1023996 KiB
no label, UUID=ba344dc1-61aa-4847-bbc4-0a78cbf05546
> swapon /swapfile
Which creates a 1GB file but then then check with swapon -s shows:
Filename Type Size Used Priority
/mnt/swapfile file 60 60 -1
Now have a total of 4 x 1GB swapfiles that only result in 240k swapspace (confirmed with free,glances, etc)
Kernel version is:
$ uname -rvmpi
3.13.0-157-generic #207-Ubuntu SMP Mon Aug 20 23:17:45 UTC 2018 i686 i686 i686
edit: installed/reverted to last working kernel version 3.13.0-153. It seems related to the L1TF mitigation stuff as suggested by Byte Commander below.
Best Answer
Looks to me like you might have run into a regression in the kernel caused by recent L1TF mitigations, which now makes your maximum swap size value overflow and reset to zero or some small number.
My guess is based on this Linux Kernel Mailing List entry from last week: https://lkml.org/lkml/2018/8/20/172
I'm afraid there's probably not much you can do except waiting until this kernel bug is fixed and the patched version gets released to Ubuntu.
Edit: alternatively, you can of course roll back to one of the previous kernel versions without any L1TF mitigation matches to be able to use swap again. Keep in mind that of course this makes you vulnerable to a critical security issue again though, so be careful and update again as soon as a fix is out.