Skip to content
Back home
The home of William Rendell
  • Home
  • Family
    • Holidays
    • Pets
    • Vehicles
  • Health and Fitness
  • Technical
    • Mikrotik
    • Computing
    • Renewable Energy
  • Privacy Policy
    • Cookie policy (UK)
  • Music
    • Harmonica
      • Easy
      • Intermediate
  • Contact
  • Search
Back home
  • Search
  • Home
  • Family
    • Holidays
    • Pets
    • Vehicles
  • Health and Fitness
  • Technical
    • Mikrotik
    • Computing
    • Renewable Energy
  • Privacy Policy
    • Cookie policy (UK)
  • Music
    • Harmonica
      • Easy
      • Intermediate
  • Contact
Home » Technical » Computing » Add swap file into linux
Computing Technical

Add swap file into linux

by William Rendell|Published February 11, 2026

fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

If RAM = 4GB
Use swap = 4GB–8GB

If RAM = 8GB
Swap = 2GB–4GB is fine

  • Linux
  • network

You may also like

Published October 22, 2018

Set physical port speed on Mikrotik

Published November 8, 2019

Add a Mikrotik user, using CLI or a script

The below can be used to add a local user to a Mikrotik using a script or at the CLI /user add […]

WiFi disconnects when an ethernet cable is connected.
Published September 30, 2020

WiFi disconnects when an ethernet cable is connected.

Try these steps to use both WiFi and Ethernet as same time: Open Registry Editor. Go to HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WcmSvc\Local. Create/change the fMinimizeConnections registry […]

Published November 15, 2021

Remote Failover testing

The below is to be used in a script to test failover based on firewall rules

Post navigation

  • Previous post install Proxmox guest agent in Debaim
  • Back to post list
  • Next post Install Webmin on Rocky 10

© 2026  – All rights reserved

Powered by WP – Designed with the Customizr Theme