FS#66979 - [linux] version 5.7.2.arch1-1 breaks swap file mounting
Attached to Project:
Arch Linux
Opened by Javier (je-vv) - Thursday, 11 June 2020, 20:53 GMT
Last edited by freswa (frederik) - Sunday, 13 September 2020, 15:03 GMT
Opened by Javier (je-vv) - Thursday, 11 June 2020, 20:53 GMT
Last edited by freswa (frederik) - Sunday, 13 September 2020, 15:03 GMT
|
Details
Description:
When upgrading linux from 5.6.15.arch1-1 to current 5.7.2.arch1-1, after booting, I get that the swap wasn't mounted, and on a "sudo swapon -a" I get the error: dswapon: /swap: swapon failed: Invalid argument Reformatting the swap FS with "sudo mkswap -L swap /swap", although giving no issues, doesn't help at all getting my /swap file mounted as swap, and on mounting I still get the same error. My fstab entry for swap: /swap none swap nodev,nosuid 0 0 The only way to get the swap file mounting, is to revert linux back to 5.6.15.arch1-1. Additional info: * package version(s) linux 5.7.2.arch1-1 (linux version 5.6.15.arch1-1 works just fine) * config and/or log files etc. /etc/fstab ... /swap none swap nodev,nosuid 0 0 ... Steps to reproduce: See Description. |
This task depends upon
FS#66921?At any rate, it does seem the same. In the end the swap file doesn't get mounted...
"Note: dynamic space allocation such as using fallocate is not supported, as it causes problems with some file systems such as F2FS[1] and will likely fail to activate at boot time with error "swapon: swapfile has holes" as of kernel 5.7. Hence, contiguous allocation, such as dd, is the only reliable way to allocate a swap file.[2]" (https://wiki.archlinux.org/index.php/Swap#Swap_file).
Simply delete the file and use dd to make it. Here's what I did, and it worked:
swapoff /swapfile
rm -f /swapfile
dd if=/dev/zero of=/swapfile bs=1M count=16384 status=progress
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
Thanks !
I personally used:
dd if=/dev/zero of=/swapfile bs=1G count=[NUMBER OF GB OF SWAP WANTED] status=progress
(note: a block is created in the ram, using bs=1G means that you need more than 1GB of ram, if you don't use a lower value but more count)