My system has 4gb of ram, At time of installation I selected “swap to File”(btrfs), and it created 512mb of /swap/swapfile. Now I think it should be larger, or of be other swap type. Help me increase or change it show I can easily run nodejs and lots of browsing tab.
- Turn off all swap processes
sudo
swapoff -a
- Resize the swap to be 8GB for example
sudo dd if=/dev/zero of=/swapfile bs=1M count=8192
For 4GB will have to be 4086
if = input file
of = output file
bs = block size
count = multiplier of blocks
- Change permission
sudo chmod 600 /swapfile
- Make the file usable as swap
sudo mkswap /swapfile
- Activate the swap file
sudo swapon /swapfile
- Edit /etc/fstab and add the new swapfile entry if it isn’t already there
/swapfile none swap sw 0 0
- Check the amount of swap available:
grep SwapTotal /proc/meminfo
5 Likes
~ sudo swapon /swapfile
swapon: /swapfile: swapon failed: Invalid argument
Are you using bash or zsh? What kernel?
If any doubt, please check Swap - ArchWiki
zsh with kernel 5.14
Try with bash
and if that doesn’t work, try with a LTS kernel.
ok trying
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.