extend swap space

From WebHostingNeeds.com
Jump to: navigation, search

EXTEND SWAP SPACE

Extend the SWAP space with "250" MB don't remove the existing swap.

fdisk -cu /dev/vda
print the partitions to see if there is one currently and what is available
Command (m for help): p
Print the current partitions
create a new partition
Command (m for help): n
Command action   
e   extended
p   primary partition (1-4) p
Partition number (1-4): 1
First sector:  
Last sector:
w

Reboot the system

init 6

Create swap with mkswap

mkswap /dev/vda4

Edit /etc/fstab

     
vi /etc/fstab

Add

/dev/vda4  swap swap  defaults 0 0

Mount all partitions listed in /etc/fstab

mount -a

Swap devices in /etc/fstab are made available.

swapon -a

Display swap usage summary by device.

swapon -s


Example

[[email protected] ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       1048568 129852  0
[[email protected] ~]#



rhcsa

swap