Showing posts with label swap1. Show all posts
Showing posts with label swap1. Show all posts

Tuesday, January 17, 2017

How to create or increase a swap partition on Solaris

In this post, I will explain to you, how to create or increase a swap partition on Solaris operating system. Swap partition is more useful file system which is used on Solaris as a virtual memory. Once the resource memory utilization get full, then swap memory comes in the role which maintain the server performance on the Solaris operating system.

If your Solaris server is connected to SAN storage then we will create a extra swap partition with storage. Normally ZFS file system we are using in Solaris operating system. By default swap partition which we created during Solaris OS installation is use rpool. In my case we are using SAN storage space to create the new swap partition.

Step by Step method of creation of swap partition:

1. First you can check the current swap space with below command.

     sun#swap -l
     swapfile             dev    swaplo   blocks     free
     /dev/zvol/dsk/rpool/swap 228,1        16  8388592  5850576

If you see the the output, only one "swap" named file is created on the server.

Note: this is default swap partition which we created during OS installation.

2. Now I want to increase my swap partition. for this please run the below command.

    sun#zfs create –V 64G san/swap1

    sun#swap –a /dev/zvol/dsk/san/swap1

In above command, I will created the new swap file "swap1" with 64 GB.

3. Swap partition is created now, you can check the status by below command
 
    sun#swap -l

4. For permamnent entry please add this file system in /etc/vfstab

/dev/zvol/dsk/san/swap1 -       -       swap    -       no      -

Note: If after reboot or shutdown the server, swap space is not present then please check the /dev/zvol/dsk/san directory and found the swap file name after that run the below command

swap –a /dev/zvol/dsk/san/swap1

Hope, you like this post, In case of any query please comment on this post, I will try to resolve your problem asap.