Use a portion of your SSD drive as additional memory

By EssingtonITS team ·

Learn how to use a portion of your SSD as additional memory in Linux by creating a swapfile. This guide explains the steps to set up, enable, and manage a swapfile for improved performance.

You can use a swapfile as a temporary addition to your system memory within the Linux environment. With an SSD drive, you can utilise a storage space swapfile and take advantage of the SSD's read/write performance.

First, create the file itself with:

sudo dd if=/dev/zero of=/swapfile bs=1M count=1024

This command will create a file named swapfile inside your root folder, its content being all zeroes and size of 1024 megabytes (1 GB). To make it 2 GB, change the count value to 2048.

Next, make it readable and writable by root only with:

sudo chmod 600 /swapfile

Then format it as swap with:

sudo mkswap /swapfile

Enable the file using:

sudo swapon /swapfile

You can disable it at any point using the sudo swapoff /swapfile command and remove it at will. Since we don't add it to the /etc/fstab file here, it won't be added at the next boot, so you can remove it after rebooting.

To have the swap automatically mount at boot time, insert the following line in /etc/fstab:

/swapfile    none    swap    sw    0   0

Looking to enhance your Linux infrastructure? At EssingtonITS.co.uk, we offer expert support and tailored solutions to optimise your systems. Let us help you achieve seamless integration and improved performance.

person people found this useful.

Related

Knowledge base 16 Oct 2026

Building a Windows 11 gold template

Learn how to create a Windows 11 gold template in Proxmox for VDI environments, allowing for efficient desktop pool management. This guide is aimed at engineers and includes steps for setting up, configuring, and testing the template.

Knowledge base 10 Oct 2026

eLLA - Settings, Options and Skills Reference

eLLA is a command-line assistant for system administration. It connects to an eLLM endpoint (any OpenAI-compatible API with tool calling), runs read-only diagnostics on its own, and asks for approval before it changes anything. This article lists every setting, command, option and bundled skill.

Knowledge base 23 Sep 2026

eSAM and exam regulations

eSAM addresses every requirement in JCQ Appendix 1 that software can address. The rest, who is sitting there, how the room is laid out, how many invigilators are watching stay with the centre, and eSAM tells you exactly which those are.

Expand 29 Jul 2026

How AI can support pupils with SEND

Explore how AI tools are aiding pupils with special educational needs and disabilities by simplifying text, breaking down tasks, and enhancing accessibility. Learn about the considerations schools should make before implementation.

Expand 29 Jul 2026

AI policy and practice in further education

Further education colleges need distinct AI policies due to their unique mix of vocational courses, diverse age groups, and specific funding and inspection requirements. This guidance highlights the importance of tailored AI approaches in FE settings.