Forrest logo
back to the mkswap tool

mkswap:tldr:45dc6

mkswap: Setup a given partition as swap area.
$ sudo mkswap ${-dev-sdb7}
try on your machine

The command you provided is invalid as it contains typos and improper formatting. Here's a corrected version:

sudo mkswap /dev/sdb7

This command is used to create a swap space on a specific device, which in this case is /dev/sdb7. Swap space is a portion of a hard disk drive (HDD) or solid-state drive (SSD) that is used as virtual memory by the operating system.

The sudo command is used to execute the following command as a superuser or administrator, providing elevated privileges for the operation.

mkswap is the command that creates the actual swap space on the specified device. It sets up the necessary data structures and formatting required for the system to effectively use it as swap space.

/dev/sdb7 represents the device on which the swap space is being created. In this case, it refers to the seventh partition on the sdb device. The naming convention /dev/sdXN is commonly used in Linux to represent storage devices and their partitions, where X is a letter representing the device and N represents the partition number.

By running this command with superuser privileges, a swap space will be created on /dev/sdb7, allowing the system to offload some memory content onto the disk when the physical memory is full or in high demand.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mkswap tool