Posts

Showing posts with the label swap disk

How to add more swap space by adding new swap partition in RHEL or CentOS 7 ?

How to add more swap space by adding new swap partition in RHEL or CentOS 7 What is swap? Swap space on a disk is used when the amount of physical RAM is full in the Linux system. When the system runs out of RAM, inactive pages are moved from the RAM to the swap space. Swap space can be either a dedicated swap partition or a swap file. So here we will see how you can add more swap space as a swap file. In this article we will see how we can add more swap space using a new swap partition. Steps : Let's check how much swap is available on the system currently: [root@localhost ~]# swapon --show [root@localhost ~]# free -h I have a new 10GB disk named "/dev/sdb" and i want to use it as a swap space. [root@localhost ~]# fdisk -l Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Step 1 : Create a...