Oracle Cloud Infrastructure- Adding a block volume and use it for swap

Hello everyone, this is my first blog on Oracle Cloud Infrastructure.

Requirement

To increase Swap of existing compute instance with a new block volume in OCI.

Prerequisite

A valid OCI account with available credits

Steps to Achieve

1. Create a new block volume 550GB
2. Attach the block volume to the instance
3. Execute iscsi commands and verify the disk attachment provided by OCI
ls -l /dev/orcleoci/
4. Do partitioning of the disk to 120GB for swap
    Making the swap partition of required space 120GB

fdisk <NEWLY_ADDED_DISK>
    Command (m for help): n
    Partition number (1-4): 2
    Command (m for help): t
    Hex code (type L to list codes): 82
    Command (m for help): w
    ls -l /dev/orcleoci/

5. Executing necessary commands to check the space and mount the new swap-
  • Check disks    lsblk
  • Make Swap    mkswap -L sasswap2 /dev/<DISK_PARTITION_ID>
  • Check Free Memory    free -m
  • Update fstab for permanemt changes Do UUID entry in fstab
  • Mount it    swapon -a
  • Check Free Memory    free -m
  • Check swap storage usage   swapon -s
  • Remove new swap swapoff /dev/<DISK_PARTITION_ID>
  • Check Free Memory free -m
  • Mount again    swapon -a

Below is the end to end demonstration of above steps-




Comments

Post a Comment

Popular posts from this blog

Oracle SOA Suite- Implementing Email Notification

Oracle SOA Suite 12c- PKIX path building failed & unable to find valid certification path to requested target

Migration of Oracle SOA Suite Composite from 11g to 12c