Difference between revisions of "Add volume as a SWAP memory"

From SmartHCM Wiki
Jump to navigation Jump to search
(Created page with "'''Run lsblk to check new volume, it will appear as /dev/xvdf on instance.''' $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 256G 0 disk └─xv...")
 
Line 1: Line 1:
'''Run lsblk to check new volume, it will appear as /dev/xvdf on instance.'''
+
'''1. Run lsblk to check new volume, it will appear as /dev/xvdf on instance.'''
  
 
$ lsblk
 
$ lsblk
Line 12: Line 12:
  
  
'''Set up the swap area'''
+
'''2. Set up the swap area'''
  
 
$ sudo mkswap /dev/xvdf
 
$ sudo mkswap /dev/xvdf
  
  
'''Enable swap'''
+
'''3. Enable swap'''
  
 
$ sudo swapon /dev/xvdf
 
$ sudo swapon /dev/xvdf
  
  
'''Make this swap setting persist by adding following line in /etc/fstab'''
+
'''4. Make this swap setting persist by adding following line in /etc/fstab'''
  
 
$ sudo nano /etc/fstab
 
$ sudo nano /etc/fstab
Line 28: Line 28:
 
/dev/xvdf none swap sw 0 0
 
/dev/xvdf none swap sw 0 0
  
'''Check swap space'''
+
'''5. Check swap space'''
  
 
$ sudo swapon --show
 
$ sudo swapon --show

Revision as of 08:03, 26 October 2021

1. Run lsblk to check new volume, it will appear as /dev/xvdf on instance.

$ lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

xvda 202:0 0 256G 0 disk

└─xvda1 202:1 0 256G 0 part /

xvdf 202:80 0 32G 0 disk


2. Set up the swap area

$ sudo mkswap /dev/xvdf


3. Enable swap

$ sudo swapon /dev/xvdf


4. Make this swap setting persist by adding following line in /etc/fstab

$ sudo nano /etc/fstab

/dev/xvdf none swap sw 0 0

5. Check swap space

$ sudo swapon --show

NAME TYPE SIZE USED PRIO

/dev/xvdf partition 32G 279.9M -1