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.
Pool
20 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 pool namespace has 23 commands, and is based on pool creation and management functions found in the SCALE API and web UI. It provides access to storage pool methods through the pool commands.
The following pool commands allow you to create new pools and manage existing pools.
You can enter commands from the main CLI prompt or from the snapshot namespace prompt.
Enter the
--
flag following any CLI command to open the interactive arguments editor text-based user interface (TUI).
Use the attach
command to add disks to a VDev.
The target_vdev
is the GUID of the VDev (pool) where you need to attach the disk. A GUID is a random and unique 64-bit identifier for a pool, VDev, or disk.
If attaching to a stripe VDev (pool), this is the striped disk GUID that is converted to a mirror.
If attaching to a mirror VDev, the mirror is converted to an n-way mirror.
ZFS supports n-way mirroring. This means you can add disks into a mirror VDev. See TrueNAS ZFS Primer for more information.
Use theThis command only works with mirror and stripe VDevs. You cannot use this command if the pool is in a RAIDz configuration.
storage disk query
command to locate the zfs_guid number.
Use the disk ID with the storage disk get_instance
command to find the zfs_guid for a specific disk in a format easier to read.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 attachments
command returns a list of services the pool matching the specified ID is using.
The create
command creates a new pool, specifies the type of VDev(s) and number of disks for each VDev in the pool.
This command performs the same functions as the Pool Creation Wizard in the UI.
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 detach
command detaches a disk from the pool matching the ID entered. Removing a disk from a mirror pool changes the pool VDev to a stripe.
Use the storage disk query
command to locate the vdev_guid for the disk.
The expand
command increases the pool size to match all available disk space for the pool matching the ID specified. Pools using virtual disks use this option to resize the virtual disks apart from TrueNAS.
The export
command exports the pool/data for the pool matching the ID specified. Exporting a pool disables services, terminates any processes the pool uses, removes disks from the pool then cleans up after the export.
Use with the options
properties to completely destroy the pool and data, remove all attachments, and to restart any services associated with the pool.
Use without the options
property argument to just export the pool.
If using on an HA system with failover is enabled, and exporting/disconnecting the last zpool, then this raises an EOPNOTSUPP error. Failover must be disabled before exporting the last zpool on the system.
The filesystem_choices
command lists the dataset paths available on the system. Use the properties to modify the list to only include zvols (volumes) on the system.
The get_disks
command lists the disks found in the pool matching the ID entered, or if no ID is entered, all disks on the system.
The get_instance
command returns a table of properties for the pool matching the ID entered.
To view the same properties for all pools on the system use the query
command.
The get_instance_by_name
command returns a table of properties for the pool matching the name entered.
Use when you do not have the ID number required to use the get_instance
command.
To view properties for all pools on the system use the query
command.
The import_find
command returns a job id which can be used to retrieve a list of pools available for import. The command returns the name, guid, status, host name details.
The import
command uses information from the import_find
command output to import a pool.
The is_upgraded
command indicates if a pool is upgraded with new ZFS feature flags after upgrading SCALE to a new major release.
Use the storage pool query
command to obtain pool IDs.
Use the offline
command to take a disk in a pool, matching the ID entered, offline. This command uses the disk vdev_guid to identify the disk.
Use the storage disk query
command to locate the vdev_guid for the disk to offline.
Use the storage pool get_disks
command to identify the disks in the pool.
Use the online
command to bring a disk in a pool, matching the ID entered, online. This command uses the disk vdev_guid to identify the disk.
Use the storage disk query
command to locate the vdev_guid for the disk to offline.
Use the storage pool get_disks
command to identify the disks in the pool.
The processes
command lists processes used by the pool matching the ID entered.
The query
command returns a table (dictionary) of all pools on the system.
The remove
command removes the ZFS device from the pool matching the ID entered and wipes disks in the pool.
The replace
command removes a disk and replaces it with the disk matching the vdev_guid entered.
This command performs the same function as the disk replace UI function.
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 scrub
command starts a scrub for the pool matching the ID entered.
This command performs the same function as running a pool data integrty check (scrub) operation.
The update
command updates properties for the pool 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 upgrade
command upgrades the pool matching the ID entered with available ZFS feature flags. Use after updating SCALE to a new release or after importing a pool.
The validate_name
command validates the pool name entered.
Related CLI Storage Articles
Related Pool Articles
- Pool Creation Wizard
- Disks
- Importing a Pool
- Advanced Settings
- Advanced Settings Screen
- Fusion Pools
- Pool Creation Wizard
- Storage Dashboard
- SLOG Over-Provisioning