Symptoms

Having created your SoftNAS instance with a set storage size, it may become necessary to increase this size at a later date. Unfortunately, with iSCSI LUNs, this cannot be done via the SoftNAS UI. Expanding block-based LUNS is a task that must be performed via the command line. This guide will provide you with the necessary instructions. 

A Buurst best practice is when expanding a pool is to always use disks of the same type as the original disks used to create the pool. Using a mix of different disk types with different performance characteristics can cause performance discrepancies for the pool.

Purpose

This article will outline the command line process required in order to expand block based storage for iSCSI LUNs.

Resolution

For this article, we will assume we have an iSCSI volume created, with a size of 8 GB. (We will pretend this is 1995, which would make this a fair bit of data). We want to expand this iSCSI volume to 14 GB.

  • Log into your instance using SSH.

    For guidance on how to connect to your Linux instance, click here.
    For Guidance on how to connect to your Windows Instance, click here.

    Ensure you are logged in as root, in order to provide the appropriate credentials to perform the actions that follow.

  • The first thing to do is to list the available volumes, in order to ensure you can select the desired instance.

# zfs list

In the example below, you can see that there is our LUN_iscsi1 which is thin provisioned. The size of the volume and pool is only 7.10 gigabytes.

  •  Next, we want to obtain the current LUN size. This can be retrieved with the command:



 # zfs get volsize pool/LUN_iscsi1



  •  Next, we can verify our LUN's size before the expansion. This can be retrieved with the command:



# targetcli ls


  • Next, obtain the current reservation size with the command below ( Only for Thick Provisioned LUNS ). This will tell you what the thick-provisioned size of the volume would be. However, if you are using thin  provisioned volume(s) you can skip this step:



# zfs get reservation <pool/LUN_*





You can see that since we are using thin provisioning the Value is set to 'none'

  • Next, we can obtain the new pool size after expansion. This can be retrieved with the command:

# zfs list 


                                                     

  • If we run the command below you will notice that our volume ( LUN_iscsi1 ) has not changed after we expanded the pool:


# zfs get volsize pool1/LUN_iscsi1

                                                                                                                    

  • To reflect the change run the command below:

# zfs set volsize=14G pool1/UN_iscsi1

 
  •    Next, To verify that the change is made, rerun the get volsize command previously run prior to setting the size to verify it is set:

# zfs get volsize pool1/LUN_iscsi1

                                                                                             

# targetcli ls

                                                        

  

  • We will also want to have the reservation changed ( Only for Thick Provisioned LUNS ) - Keep in mind that you cannot have a volume that exceeds the available reservation pool space - in other words, a volume can obviously not be larger than the thick-provisioned maximum pool size. To change the reservation, run the following: (Skip this step if you are using thin provisioned volume/s)
  # zfs set reservation=<size>G **or** # zfs set reservation=<size>T


  • To verify, run the command below: Only for Thick Provisioned LUNS )     

# zfs get reservation pool1/LUN_iscsi1

                                                                                                                     

  • Now all configurations changes have been completed on the SoftNAS side. 
  • Next, on the windows side let's head to: Computer Management → Disk Management. You can see that we only have 7.10GB before the expansion.

  •   Next, let's rescan the disk to reveal the new unallocated space by clicking the Action menu → Rescan Disk. 

  • We can now see the new unallocated space.

  • Next, we can now extend the disk by doing the following and following the instructions by clicking Next through out the Menu buttons.

  • Our new expanded Volume now reflects the new size.

  •   Once the changes above are completed, not only could we see the changes reflected in the SoftNAS UI, but also, we see that the volume has been expanded in windows explorer as well.