Monday, 26 October 2015

Increasing SWAP Size at LINUX

--- CHeck The SWAP size
oracle@training01 ~]$ free
             total       used       free     shared    buffers     cached
Mem:       5854052     447260    5406792       158RHCE Portal 8      96272     159004
-/+ buffers/cache:     191984    5662068
Swap:      4194300          0    4194300


[root@training01 oracle]# cat /proc/partitions
major minor  #blocks  name

   8        0   41943040 sda
   8        1     512000 sda1
   8        2   41430016 sda2
   8       16  104857600 sdb
   8       17  104856223 sdb1
   8       32   30553616 sdc
 253        0   37232640 dm-0
 253        1    4194304 dm-1

---Add Extra HD and make partition
[root@training01 oracle]# fdisk /dev/sdc 
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xdcac03f1.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3803, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-3803, default 3803):
Using default value 3803

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@training01 oracle]# mkswap /dev/hdc1
/dev/hdc1: No such file or directory
[root@training01 oracle]# cat /proc/partitions
major minor  #blocks  name

   8        0   41943040 sda
   8        1     512000 sda1
   8        2   41430016 sda2
   8       16  104857600 sdb
   8       17  104856223 sdb1
   8       32   30553616 sdc
   8       33   30547566 sdc1
 253        0   37232640 dm-0
 253        1    4194304 dm-1
----Make The SWAP and Add The Value
[root@training01 oracle]# mkswap /dev/sdc1
Setting up swapspace version 1, size = 30547560 KiB
no label, UUID=b64150da-1805-4d22-a271-4d04d608dc0e
[root@training01 oracle]# swapon /dev/sdc1
[root@training01 oracle]# vim /etc/fstab
 ---   /dev/sdc1 swap swap defaults 0 0
[root@training01 oracle]# free
             total       used       free     shared    buffers     cached
Mem:       8060768     427876    7632892       1216      30328     154728
-/+ buffers/cache:     242820    7817948
Swap:     34741860          0   34741860
RHCE PORTAL

No comments:

  Oracle 21c Cluster Setup & DB Creation on OEL-8.4 using Virtual-box       Moto: This document is created on traditional way to Insta...