How to set recordsize on ZFS in SynetoOS 4

Written By Christian Castagna (Administrator)

Updated at October 13th, 2024

→ Applies to: SynetoOS 4.x

The term recordsize refers to the size of individual data blocks used for read-write operations. It determines the size of the chunks in which data is stored on the disk. Configuring the appropriate recordsize is critical for optimal performance based on the type of data stored and accessed.

The default block size for ZFS is 128KiB, which means that ZFS dynamically allocates blocks of any size from 512B to 128KiB depending on the size of the file to be written.

NOTE
Changes apply to the new datasets created after the resize operation.
It is therefore necessary to create a new datastore with the correct recordsize and migrate all original data into this new datastore with Syncoid.

 

Step 1. Connect to SynetoOS appliance via SSH as admin

ssh admin@<your_ip_address_or_hostname>

 

Step 2. Become Super User

sudo su

 

Step 3. Create a new datastore (replace <pool_name> and <datastore_name> with the correct information)

zfs create <pool_name>/<datastore_name>

 

Step 4. Retrieve the recordsize of the datastore (replace <pool_name> and <datastore_path> with the correct information)

zfs get recordsize <pool_name>/<datastore_path>

Example:

zfs get recordsize flash/datastores/srvApplication-DS

 

Step 5. Set the new recordsize value (replace <value>, <pool_name> and <datastore_path> with the correct information)

zfs set recordsize=<value> <pool_name>/<datastore_path>

Example:

zfs set recordsize=64K <pool_name>/<datastore_path>

Change will be applied immediately for all new data.

Old data will remain with the old recordsize; to update them, you need to create a new datastore, set the new recordsize and then migrate old data to the new datastore using Syncoid.