Expanding Thin and Thick provisioned Block Based LUNs

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. 

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

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.

For this article, we will assume we have an iSCSI volume created, with a size of 8 GB and we want to expand this iSCSI volume to 14 GB.

  • Log into your SoftNAS instance using SSH.

Ensure that you are logged in as root.
  • Using the following command, list the available volumes in order to ensure you can select the desired instance:
zfs list
In the example to the right, you can see our LUN_iscsi1, which is thin provisioned, with the size of the volume and pool being only 7.10 GiB.

  •  Obtain the current LUN size with the following command:
zfs get volsize <name_of_pool>/<name_of_LUN>

  • Verify LUN's size before the expansion using the following command:
targetcli ls

This step can be skipped if you are using thin-provisioned volume(s)

Since we are using thin-provisioning, our VALUE is set to none.


  • Obtain the current reservation size with the following command:
zfs get reservation <name_of_pool>/<name_of_LUN>

  • Obtain the new pool size after expansion using the following command:
zfs list

  • If we run the following command, we can see that our volume LUN_iscsi1 has not changed after we expanded the pool.
zfs get volsize <name_of_pool>/<name_of_LUN>

  • Reflect the change by issuing the following command:
zfs set volsize=<size> <name_of_pool>/<name_of_LUN>
  • Verify that the change has been made by running the following command:
zfs get volsize <name_of_pool>/<name_of_LUN>

  • Verify LUN's size by using the following command:
targetcli ls

This step is ONLY for thick-provisioned LUNS.  This step should be skipped if you are using thin-provisioning.

  • To change the reservation, run the following command:
zfs set reservation=<size><G or T>


  • To verify, run the following command:
zfs get reservation <name_of_pool>/<name_of_LUN>

  • Move to your Windows device.

  • Navigate to Computer Management > Disk Management

You can see that we only have 7.10GB before the expansion

  • Rescan the disk to reveal the new unallocated space by navigating to Action > Rescan Disks.

  • The new unallocated space can now be seen.

  • Extend the disk by Right-Clicking on the unallocated space and selecting Extend Volume...



Follow the Extend Volume Wizard instructions.


  • Our newly expanded volume now reflects the new size.

  • The changes can be seen in the SoftNAS UI and Windows Explorer.