Skip to main content

Expanding Swap Memory online in Oracle Linux.

 

Steps:

1) Turnoff  Current Swap Device

2) Make Swap Device by fallocate and filling zeros

3) change mount permission to root only 

4) swapon newly created mount.


Example:-

login as: root

root@10.0.0.65's password:

Last login: Mon Oct  4 02:29:55 2021 from mmd-12713385543

[root@ol7-19 ~]# swapoff -v /dev/mapper/ol-swap

swapoff /dev/mapper/ol-swap

[root@ol7-19 ~]# fallocate -l 4G /swape


[root@ol7-19 ~]# dd if=/dev/zero of=/swape bs=1024 count=4194304

4194304+0 records in

4194304+0 records out

4294967296 bytes (4.3 GB) copied, 16.5165 s, 260 MB/s

[root@ol7-19 ~]# ls ltr /

ls: cannot access ltr: No such file or directory

/:

bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  swape  sys  tmp  u01  u02  usr  var

[root@ol7-19 ~]# ls -ltr /

total 8388576

drwxr-xr-x.   2 root   root              6 Apr 10  2018 srv

drwxr-xr-x.   2 root   root              6 Apr 10  2018 opt

drwxr-xr-x.   2 root   root              6 Apr 10  2018 mnt

drwxr-xr-x.   2 root   root              6 Apr 10  2018 media

lrwxrwxrwx.   1 root   root              7 Oct  4 01:49 bin -> usr/bin

lrwxrwxrwx.   1 root   root              9 Oct  4 01:49 lib64 -> usr/lib64

lrwxrwxrwx.   1 root   root              7 Oct  4 01:49 lib -> usr/lib

lrwxrwxrwx.   1 root   root              8 Oct  4 01:49 sbin -> usr/sbin

drwxr-xr-x.  13 root   root           4096 Oct  4 01:49 usr

drwxr-xr-x.  19 root   root           4096 Oct  4 01:59 var

dr-xr-xr-x.   4 root   root           4096 Oct  4 02:00 boot

dr-xr-x---.   3 root   root           4096 Oct  4 02:10 root

drwxr-xr-x.   3 root   root             20 Oct  4 02:11 home

drwxrwxr-x.   3 oracle oinstall         17 Oct  4 02:20 u01

drwxrwxr-x.   3 oracle oinstall         21 Oct  4 02:20 u02

dr-xr-xr-x. 140 root   root              0 Oct  4 02:28 proc

dr-xr-xr-x.  13 root   root              0 Oct  4 02:28 sys

drwxr-xr-x.  19 root   root           3120 Oct  4 02:28 dev

drwxr-xr-x.  78 root   root           8192 Oct  4 02:28 etc

drwxr-xr-x.  25 root   root            820 Oct  4 02:29 run

drwxrwxrwt.  10 root   root           4096 Oct  4 04:34 tmp

-rw-r--r--.   1 root   root     4294967296 Oct  4 04:55 swape

[root@ol7-19 ~]# chmod 600 /swape

[root@ol7-19 ~]# ls -ltr

total 4

-rw-------. 1 root root 1460 Oct  4 01:57 anaconda-ks.cfg

[root@ol7-19 ~]# ls -ltr /

total 8388576

drwxr-xr-x.   2 root   root              6 Apr 10  2018 srv

drwxr-xr-x.   2 root   root              6 Apr 10  2018 opt

drwxr-xr-x.   2 root   root              6 Apr 10  2018 mnt

drwxr-xr-x.   2 root   root              6 Apr 10  2018 media

lrwxrwxrwx.   1 root   root              7 Oct  4 01:49 bin -> usr/bin

lrwxrwxrwx.   1 root   root              9 Oct  4 01:49 lib64 -> usr/lib64

lrwxrwxrwx.   1 root   root              7 Oct  4 01:49 lib -> usr/lib

lrwxrwxrwx.   1 root   root              8 Oct  4 01:49 sbin -> usr/sbin

drwxr-xr-x.  13 root   root           4096 Oct  4 01:49 usr

drwxr-xr-x.  19 root   root           4096 Oct  4 01:59 var

dr-xr-xr-x.   4 root   root           4096 Oct  4 02:00 boot

dr-xr-x---.   3 root   root           4096 Oct  4 02:10 root

drwxr-xr-x.   3 root   root             20 Oct  4 02:11 home

drwxrwxr-x.   3 oracle oinstall         17 Oct  4 02:20 u01

drwxrwxr-x.   3 oracle oinstall         21 Oct  4 02:20 u02

dr-xr-xr-x. 140 root   root              0 Oct  4 02:28 proc

dr-xr-xr-x.  13 root   root              0 Oct  4 02:28 sys

drwxr-xr-x.  19 root   root           3120 Oct  4 02:28 dev

drwxr-xr-x.  78 root   root           8192 Oct  4 02:28 etc

drwxr-xr-x.  25 root   root            820 Oct  4 02:29 run

drwxrwxrwt.  10 root   root           4096 Oct  4 04:34 tmp

-rw-------.   1 root   root     4294967296 Oct  4 04:55 swape

[root@ol7-19 ~]# mkswap /swape

Setting up swapspace version 1, size = 4194300 KiB

no label, UUID=8a0c14c0-4492-415f-b186-598e373609d3

[root@ol7-19 ~]# swapon /swape


[root@ol7-19 ~]# free -g

              total        used        free      shared  buff/cache   available

Mem:              1           1           0           0           0           0

Swap:             3           0           3

[root@ol7-19 ~]#


Comments

Popular posts from this blog

Aws File Storage gateway insights #2

  S3 is object storage emulated as NFS using AWS file storage gateway; we need to understand S3 object operations and associated charges. Putting more frequent changing files on the AWS file storage gateway may surge the cost. Below is the AWS file operation vs S3 object impact. Interestingly, in LAB, I observed that even if you are accessing the S3 console using the AWS console for administrative purposes, it is calling the list API call or getting the files list. With help of FUSE and S3fs,  on premise NFS exported files were able to access in  cloud EC2 instances. This is very useful incase of you have some systems that needs hybrid file access. [root@ip-172-31-13-8 s3fs-fuse]# s3fs rmanbackupdemo -o use_cache=/tmp -o allow_other -o uid=1001 -o mp_umask=002 -o multireq_max=5 /mys3mount [root@ip-172-31-13-8 s3fs-fuse]# c /mys3mount/ -bash: c: command not found [root@ip-172-31-13-8 s3fs-fuse]# cd /mys3mount/ [root@ip-172-31-13-8 mys3mount]# ls awstest [root@ip-172-31-13-...

AWS Datasync overview

AWS DataSync is an online data transfer service that simplifies, automates, and accelerates copying large amounts of data between on-premises storage systems and AWS Storage services and between AWS Storage services.  For example, DataSync can copy data between Network File System (NFS), Server Message Block (SMB) file servers, self-managed object storage,  S3 buckets, EFS  file systems, and Amazon FSx. Above diagram depicts the typical architecture of AWS Datasync services. How it works:  1) Data Sync Service: Service in the AWS cloud, which manages and tracks data sync tasks, schedules  2) Data Sync Agent: A Virtual Appliance with computing power to run scheduled copy, uploading capability and maintain metadata (for full and incremental data transfer ) deployed at on-premise or cloud.  Advantages: a) Cost-effective solution for Data Sync task ( service charged for per GB transfer in only) b) Best suited for aggressive deployment with zero-touch existing i...

Change Block Tracking (CBT) and VM Backups in VMware

As I started my IT career from Backup Engineer to whatever today I am, I thought my first post on VMware should be on VM backup strategy, especially on Change Block Track for CBT mechanism   CBT (Change Block Track) is allows backup applications to take incremental backups rapidly on VM. CBT uses VMware Storage API formerly known as VMware Storage API for Data Protection (VADP for more info https://kb.vmware.com/s/article/1021175) . Below are the steps involved in enabling CBT on a VM.        1). We need to define the CBT setting by configuring the VM configuration parameters ctkEnable= “True” (Advanced /General> Configuration Parameters).        2). Above setting enables CBT global leve mean every disk can be tracked by CBT means you are allowed do a snapshot on VMDK file to track the changes for backup but independent or multi writer disks does not t like this setting to be enabled and it is not recommended too. ...