Hello, I seem to be unable to create swapfiles in Leap 15.5
I need to do this because despite having disabled suspension and hibernation my VM keeps crashing in kernel panic when I leave it idle for too long. (Presumably it’s still suspending somehow, regardless.)
So I asked chatGPT (yes I know) to help me make a swapfile.
I followed the following steps:
1: sudo dd if=/dev/zero of=/swapfile8GB bs=1G count=8
2: sudo chmod 600 /swapfile8GB
3: sudo mkswap /swapfile8GB
4: sudo nano /etc/fstab
5: added the following line to the /etc/fstab file: /swapfile8GB none swap defaults 0 0
6: sudo swapon -a
I got the following output from my command prompt: swapon: /swapfile8GB: swapon failed: Invalid argument
So I tried something else, I added the UUID of the swapfile to the /etc/fstab file instead in the proper format, and did the command again. Got this message: swapon: cannot find the device for UUID=
So I tried something else, I copied the UUID, manually added the UUID to the file and added a label for good measure: mkswap -L swapfile8GB -U . Added this to the fstab file too with the label in tow in the correct way.
The time came for swapon -a, same error as before.
I have tied remaking the swap file, giving it different names, deleting it, doing it again and again and again, nothing worked. I catted out the file /proc/sys/vm/swappiness: “60”
According to chatGPT it should theoretically work. Despite theory, it does not.
I am at a loss, I could not find anything about this online, the only semi similar result I found was that if your Unix kernel has an older version that you can’t add swap files. But as far as I’m aware that’s not the case here.
I don’t know what else to do, chatGPT even said to ask the forums here because it could not help me any further.
I even tried turning it off and turning it back on again.
Hopefully someone in this forum has answers. Reinstalling the VM with a bigger swap partition is not an option, I just got it working in the way I wanted it to with all the software I needed. The thought of having to go through all of that again gives me a massive headache. This petty annoyance has also grown out of proportion, however.
Thanks in advance.