Sharing Ilmu

Sharing for useful things

How Add/Creata new partition swap on linux

In this tutorial, I’ll explain to you about how to add or create new partition swap on linux os. swap are using for supplementary RAM space by holding inactive pages in memory¬† are called virtual memory.

The following are step by step for create new new partition swap :

In this tutotial I’ve add new partition disk for adding the new swap partition. check the partition disk with¬†lsblk command. as the shown image bellow has new partition with name dbd.

add gpt label for /dev/vdb partition and then check the partition system for /dev/sdb

# parted /dev/sdb mklabel gpt

# parted /dev/sdb print

Show swap partition with swapon –show command. as the following images system have one swap partition.

Create new swap parititon named as swap2 with 1GB size.

# parted /dev/sbd mkpart swap2 linux-swap 1MB 1001MB

then check the partition on /dev/sdb with parted /dev/sdb print. as the following images, new parititon has been create with name swap2 and 1GB of size.


use mkswap command for create swap type for /deb/sdb1


active the swap on /dev/sdb1 with swapon command. and then show swap partition. as the following images new partition swap has successful create.

Do configure on fstab so that new swap partition will be mounted as automatically.

After that reboot your system, then check swap partition.

Configure has been successfully.

Leave a Reply

Your email address will not be published. Required fields are marked *.

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>