Artix Linux Forum

Artix Linux => System => Topic started by: Artt on 05 November 2023, 22:36:13

Title: Problems with making a swap file
Post by: Artt on 05 November 2023, 22:36:13
Hello,
I wanted to make a swapfile, but I have run into a problem with it.

Here is my shell "log":
Code: [Select]
[host /]# fallocate -l 2G /swapfile
[host /]# chmod 600 swapfile
[host /]# mkswap /swapfile
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=e19bca21-75ec-428a-b3f8-8dd847b2a76a
[host /]# swapon -v /swapfile
swapon: /swapfile: found signature [pagesize=4096, signature=swap]
swapon: /swapfile: pagesize=4096, swapsize=2147483648, devsize=2147483648
swapon /swapfile
swapon: /swapfile: swapon failed: Invalid argument
[host /]# swapon -a
[host /]# swapon --show
[host /]# free
               total        used        free      shared  buff/cache   available
Mem:        16066972     5558368     5481120     1800276     7168064    10508604
Swap:              0           0           0

Do any of you know why this is happening?
Title: Re: Problems with making a swap file
Post by: Ambie on 06 November 2023, 12:50:12
What filesystem is your / ? For btrfs there's another approach: https://wiki.archlinux.org/title/Btrfs#Swap_file
Title: Re: Problems with making a swap file
Post by: mardiyah on 10 November 2023, 14:08:20
lsblk -f
?
if ready  as file /swap on doing:

swapon --show

then
$ faalocate -l 4 GB /swap

$ sudo mkswap /swap