Skip to content

Instantly share code, notes, and snippets.

@alexanderstephan
Created August 15, 2021 17:07
Show Gist options
  • Save alexanderstephan/017a4866fecbc0bfd1eac9e5d2c1c0d8 to your computer and use it in GitHub Desktop.
Save alexanderstephan/017a4866fecbc0bfd1eac9e5d2c1c0d8 to your computer and use it in GitHub Desktop.
Create a swap file on Manjaro or Arch
# Create the file itself
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096 status=progress
# Only root should be able to read and write
sudo chmod 600 /swapfile
# Format the swap file
sudo mkswap /swapfile
# Enable the swap
sudo swapon /swapfile
# Add entry in /etc/fstab for auto start
sudo bash -c "echo /swapfile none swap defaults 0 0 >> /etc/fstab"
@strydex
Copy link

strydex commented Jun 11, 2024

saved for future use cases for potato machines 👯‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment