Hello everyone.
I have tried setting up a Swapfile using this guide: Swap - Manjaro
I have no Swap Partition but realised I need a Swap because I ran out of memory a couple of times, due to a software with a memory leak.
I followed every step in the guide from 1 to 4, skipping 5 (Swap Partition), starting again at 6. I altered the command to create a Swapfile to create one with 6 GB (instead of 4 as in the example) because that’s what I calculated using the information in the guide.
As far as I can tell, the Swapfile was created uneventful and I can also see it in Dolphin. I then set permission as in the guide and tried to format it. This is when I encountered my problem. I used the command sudo mkswap /swapfile from the guide but got the following in return:
mkswap: /swapfile contains holes or other unsupported extents.
This swap file can be rejected by kernel on swap activation!
Use --verbose for more details.
mkswap: /swapfile: warning: wiping old swap signature.
Setting up swapspace version 1, size = 6 GiB (6442446848 bytes)
no label, UUID=9f1d0366-c807-45dc-bccf-04a884afd66f
I cannot continue with the guide using sudo swapon /swapfile, as when I use that command I get the following:
swapon: /swapfile: swapon failed: Invalid argument
I did search for the issue but only found the advice to recreate the swapfile using dd instead of fallocate. This doesn’t help much since the command in the guide used dd already so that’s what I used. The only time I deviated from the guide was when I changed count=4096 to count=6144 during the creation of the Swapfile, I did not change any other part of any command.
Please note that I am very new to Linux in general, I tried my best to follow every step of the guide but it is very possible the guide might require some form of common knowledge I didn’t acquire yet. I am grateful for any help, more detailed explanations might certainly help me understand what is going on better though. Thank you in advance.