System and processes

The mkswap command

Prepares a partition or file to be used as swap memory.

Syntax

mkswap DISPOSITIVO

Copy-ready examples

$ sudo mkswap /dev/sda2Prepare the swap

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • mkswap only prepares; you must enable it afterwards with swapon.

Related commands

FAQ

What is swap?

Disk space the system uses as memory when it runs out of RAM.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course