Showing posts with label ZFS. Show all posts
Showing posts with label ZFS. Show all posts

Thursday 25 May 2017

How to increase the file system size in Solaris 10/11 operating system

When you file system get full on Sun Solaris operating system , you need to increase it but on Solaris platform it is quite different from other unix operating version.

The below method are used for both type of Sun Solaris version 10/11. You can used the same command on different version platform.

➤ Mostly on Solaris 10/11 machine we have only use default storage pool. if you server is not connected to any SAN, then zpool name should be "rpool".

If you want to check which zpool are present on the Solaris box, you can run the below command for this work.

!-[solaris]# zpool status

Using the above command you can check which zpool storage are present on the solaris server. In my case my Solaris box is connected to SAN storage, so it is display both system default "rpool" & "san" storage system.

➤ Let's suppose you want to increase the size of root file system on server, then first you need to check the current disk space on the filesystem.

To check the current file size of filesystem you can use "df -h" command. This command will show you the filesystem size in correct manner.

On my Solaris box the root filesystem was created with rpool storage, so if I need to increase or extend the size of root filesystem I need to take space from this zpool.

For example, If you want to 5 Gb more space on root filesystem then please use the below command to extend the root filesystem size more 5 Gb. In my case my current root filesystem size is 12Gb so I will extend it to 17 Gb.

!-[solaris]# zfs set quota=17G rpool/ROOT/solaris-1

You can add the 5 Gb space in your current size (12Gb).

!-[solaris]# zfs set reservation=17G rpool/ROOT/solaris-1

In above command you can reserve the 17G space to root filesystem. You can check the new filesystem space using "zfs get quota" command.

Please comment on the post if you are facing any issue regarding the filesystem.

Thursday 18 May 2017

How to Increase a Swap Space on Solaris Server

Swap memory work as a virtual memory in Unix operating systems. In Unix server when your physical memory used fully, that time swap memory are used and its maintain the system performance.

On Solaris server, if your swap size space use full then you need to create a new swap file or increase the swap space. We have a different method to increase/create a swap size on Solaris operating system server.

Here, we will discuss how to increase a swap size on Sun Solaris 11 operating system. The same steps are used for Sun Solaris 10 operating system.

In my testing machine, we are using storage space to create a new swap file as my operating system pool space are already fully utilized. 

Step by Step Method to Increase a Swap Space:

➤ On your Solaris machine , first you check the current swap space. Please use the below command to check the current running swap size.

!-[solaris]# swap -l
swapfile                               dev        swaplo   blocks       free
/dev/zvol/dsk/san/swap1     202,1        16         731596    6730226

In above example, "swap -l" command used to check the existing swap size space, you can use "top" command as well but using "top" command you can not find which swap named file are in used. You can find only total swap memory available on the Solaris server. On my solaris testing machine "swap1" file was already created which is currently in used.

➤ If you want to increase more size then you need to create a new swap file like swap2 or swap 3 as per your requirement and space available on server storage.

Let's assume on my Solaris server, I need to increase 30 GB more swap size, then you need to create new swap file.

Please use the below command to create a new swap file on Sun Solaris 11 operating system.

!-[solaris]# zfs create –V 30G san/swap2
!-[solaris]# swap –a /dev/zvol/dsk/san/swap2

In above command, we will create swap2 file with 30 GB space. Once you run both command one by one in given sequence a new swap 2 file with 30 GB has been created on the server.

➤ To verify the new swap size space, you need to run the below command.

!-[solaris]# swap -l
swapfile                               dev        swaplo   blocks       free
/dev/zvol/dsk/san/swap1     202,1        16         731596    6730226
/dev/zvol/dsk/san/swap2     209,2        16         832226    31457280

If you see the above output, the newly created swap file are seen with 30 GB space, and you can run the top command which show you the total swap memory space.

➤ To make it this swap space on Solaris server, please make an entry in "/etc/vfstab" file.

!-[solaris]# vi /etc/vfstab
/dev/zvol/dsk/san/swap1 -       -       swap    -       no      -

When we make this an entry in vfstab file, we don't need to take a reboot.  Once you take a reboot your space would be available and you can show it without any problem.

Please post your comment on this blog, if you have any query related to this topic.

How to limit ZFS arc cache size on Solaris server

If you are working on Solaris operating system then you normally facing the ZFS cache size issue while running multiple database on Solaris local zones.

As per oracle suggested if your physical Solaris server have 64 GB physical RAM then ZFS cache arc minimum size should be 2 GB, and if physical server have 128 GB RAM then ZFS arc cache size should be 4 GB. Minimum you can set the ZFS arc cache size to 512MB only.

In this post, I will show you how to limit the ZFS arc cache size on Solaris server operating system.

➤ Let's suppose your Solaris server have 128 GB physical RAM, in this case you need to set the ZFS arc cache size to 4 GB minimum.

Before doing that you must check the current cache size which are running on the server

!-[solaris]# kstat zfs:0:arcstats:size | grep size | awk '{printf "%2dMB\n",  $2/1024/1024+0.5}'
1024MB

If you see the above command output, you can see the current running cache arc size is around 1 GB.

➤ If you want to check current "zfs_arc_max" & "zfs_arc_min" cache size, then please run the below command to check this.

!-[solaris]# kstat -p zfs:0:arcstats | head -4
zfs:0:arcstats:buf_size  55652720
zfs:0:arcstats:c             1073741824
zfs:0:arcstats:c_max    1073741824
zfs:0:arcstats:c_min     268435456

If you see the current above command output the "zfs_arc_max" cache size is 1 GB approx and  zfs_zrc_min size is approx 256 MB.

➤ As in my above post, you can see, as per Oracle, the cache size should be minimum 4 GB if physical RAM of the server 128 GB. So in this step , we will change the parameter.

To set the new ZFS ARC parameter, you need to go "/etc/system" file where old cache parameter was written.

!-[solaris]# vi /etc/system

Please change the parameter according to 128 GB physical RAM, so in our case zfs_arc_max would be 6 GB and zfs_arc_min would be 4 GB.

set zfs:zfs_arc_max = 6442450944
set zfs:zfs_arc_min = 4294967296

You can set the above parameter in /etc/system file. The ZFS cache size max would be 8 GB but on my machine I used it to 6 GB only.

➤ Once you set the above step ZFS ARC parameter in the system file, you need to take a reboot of Solaris server to effect these new size permanently. 

Once the server is up , you can run the below command to check the new ZFS cache size.

!-[solaris]# kstat zfs:0:arcstats:size | grep size | awk '{printf "%2dMB\n",  $2/1024/1024+0.5}'
6144MB

If you see the above output, you can see the ZFS cache max size vary to 6 GB.

➤ You can  also use the below command to check the max. cache size on global zone.

!-[solaris]# kstat zfs::arcstats:size
module: zfs                              instance: 0
name:    arcstats                       class:    misc
              size                             6445232256
You can see the above command output, its clearly show you the new current ZFS arc cache size for 128 GB physical Sun Solaris server.

Please post the comment on this blog, if you have any query related to this topic.