TrueNAS Documentation Archive
This content follows the TrueNAS 23.10 (Cobia) releases. Archival documentation is provided for reference only and not actively maintained. Use the Product and Version selectors above to view content specific to different TrueNAS software or major version.
Dataset
37 minute read.
Last Modified 2024-03-19 08:38 EDTThe SCALE CLI guide is a work in progress! New namespace and command documentation is continually added and maintained, so check back here often to see what is new!
The dataset namespace has one namespace, user_prop and 22 commands, and is based on dataset creation and management functions found in the SCALE API and web UI. It provides access to storage dataset methods through the dataset commands. Do not use the user_prop commands.
The following dataset commands allow you to create new and manage existing datasets.
You can enter commands from the main CLI prompt or from the dataset namespace prompt.
Enter the
--
flag following any CLI command to open the interactive arguments editor text-based user interface (TUI).
The attachments
command lists services dependent on the dataset matching the ID entered.
Use the storage dataset query
or storage dataset details
command to obtain dataset IDs.
Use the change_key
command to change the encryption key properties for the dataset matching the ID entered.
The TrueNAS CLI guide for SCALE is a work in progress! This command has not been fully tested and validated. Full documentation is still being developed. Check back for updated information.
The checksum_choices
command lists checksums supported for the ZFS dataset.
The compression_choices
command lists compression alogrithms supported by ZFS.
Use the Create
command to create datasets or zvols.
Use the delete
command to delete a dataset or zvol matching the ID entered.
Use the destroy_snapshots
command to destroy snapshots for the dataset matching the ID entered.
Use the storage snapshot query
command to obtain a list of snapshots on the system.
If the system is performing a snapshot task for the dataset specified, the command returns an error stating the dataset is busy.
Use the details
command to list all datasets on the system and the services or tasks that might be consuming them.
Use the encryption_alogorithm_choices
command to list encryption alogrithms supported by ZFS.
Use the encryption_summary
command to retrieve a summary of all encrypted root datasets under the entered ID.
Use the export_key
command to export the encryption key for the dataset matching the ID entered.
Use with storage dataset encryption_summary
to identify dataset encryption types for datasets on the system.
Use the export_keys
command to export keys for the ID entered and all children of it stored in the system.
The TrueNAS CLI guide for SCALE is a work in progress! This command has not been fully tested and validated. Full documentation is still being developed. Check back for updated information.
Use the get_instance
command to list detials for the dataset matching the ID entered.
Use the get_quota
command to return a list of the specified quota_type of quotas on the ZFS dataset ds
.
The inherit_parent_encryption_properties
command allows inheriting parent dataset encryption root disregarding the current encryption settings.
Use only when the specified dataset ID is an encrypted parent and ID itself is an encryption root (parent to encrypted child datasets).
Use the lock
command to lock the dataset matching the ID entered.
Only works with datasets using passphrase encryption. Datasets with key encryption return an error.
The TrueNAS CLI guide for SCALE is a work in progress! This command has not been fully tested and validated. Full documentation is still being developed. Check back for updated information.
Use the mountpoint
command to obtain the mountpoint for the dataset matching the ID entered.
Use the permission
command to set the owner and group, and other dataset permission options (i.e., recursive, traverse, etc.) for the dataset matching the ID entered.
The permissions
command is complex. Use either the UI Edit ACL screen or the the interactive arguments editor/text user interface (TUI) to configure ACL permissions.
Use the processes
command lists the processes using the dataset matching the ID entered.
Use the promote
command to promote a the cloned dataset matching the ID entered.
Use the storage snapshot query
command to list snapshots on the system.
Use the query
command to list all configured datasets, enter storage dataset query
.
Information provided includes id (name), type, name, pool encryption settings, child datasets, comments, ACL mode and type, checksum, compression settings, quota settings, and other settings found on the Dataset add and edit screens in the UI.
To include the services consuming the dataset use the storage dataset details
command.
The recommended_zvol_blocksize
command is a helper method to get recommended size for a new zvol (dataset of type VOLUME).
Use when creating a zvol using the storage dataset create
command volblocksize
property argument to enter a blocksize.
The recordsize_choices
command lists record size options to use with the
Use the set_quota
command to set quotas for the dataset matching the identifier specified.
There are three over-arching types of quotas for ZFS datasets:
- Dataset quotas and refquotas.
If specifying aDATASET
quota type, then the command acts as a wrapper for pool.dataset.update. - User and group quotas. These limit the amount of disk space consumed by files that are owned by the specified users or groups. If specifying object quota types is specified, then the quota limits the number of objects the specified user or group can own.
- Project quotas. These limit the amount of disk space consumed by files that are owned by the specified project. Project quotas are not yet implemented.
This command allows users to set multiple quotas simultaneously by submitting a list of quotas. The list can contain all supported quota types.
Use the account user query
command or the UI to obtain the UID for the user entered into the command string.
The snapshot_count
command lists the snapshot count for the dataset matching the name entered.
Use the unlock
command to unlock the dataset or zvol matching the ID entered.
This command only works with datasets locked with a password.
The TrueNAS CLI guide for SCALE is a work in progress! This command has not been fully tested and validated. Full documentation is still being developed. Check back for updated information.
Use the unlock_services_restart_choices
command to get mapping of services identifiers and labels that can be restarted on dataset unlock.
The TrueNAS CLI guide for SCALE is a work in progress! This command has not been fully tested and validated. Full documentation is still being developed. Check back for updated information.
Use the update
command to update settings for the dataset or zvol matching the ID entered.
Related CLI Storage Articles
Related Dataset Articles
- Adding and Managing Datasets
- Advanced Settings Screen
- Capacity Settings Screen
- Managing User or Group Quotas
- Snapshots Screen
- User and Group Quota Screens
- Snapshot
- Encryption Settings
- Storage Encryption