LinuxCommandLibrary

zpool

Manage ZFS storage pools

TLDR

List all pools

$ zpool list
copy
Show pool status
$ zpool status [pool]
copy
Create a mirrored pool
$ sudo zpool create [pool] mirror [/dev/sda] [/dev/sdb]
copy
Create a RAID-Z pool
$ sudo zpool create [pool] raidz [/dev/sda] [/dev/sdb] [/dev/sdc]
copy
Add devices to pool
$ sudo zpool add [pool] [/dev/sdc]
copy
Start a scrub
$ sudo zpool scrub [pool]
copy
Import a pool
$ sudo zpool import [pool]
copy
Export a pool
$ sudo zpool export [pool]
copy

SYNOPSIS

zpool command [options] [arguments]

DESCRIPTION

zpool manages ZFS storage pools. A pool is composed of virtual devices (vdevs) which can be single disks, mirrors, or RAID-Z configurations. Pools provide the underlying storage that ZFS datasets use.
Vdev types:
- mirror - Data mirrored across 2+ disks
- raidz, raidz2, raidz3 - RAID-Z with 1/2/3 parity disks
- spare - Hot spare disk
- cache - L2ARC read cache (SSD)
- log - ZIL write log (SSD)
Scrubbing verifies all data checksums and repairs errors using redundant copies. Regular scrubs are essential for data integrity.

SUBCOMMANDS

create pool vdev...

Create new storage pool
destroy pool
Destroy pool and all data
add pool vdev...
Add devices to pool
remove pool device
Remove device from pool
list [pool]
List pools and properties
status [pool]
Show detailed status
iostat [pool] [interval]
Display I/O statistics
scrub pool
Verify data integrity
import [pool]
Import pool(s)
export pool
Export pool for transport
upgrade pool
Upgrade pool version
history pool
Show pool command history
attach pool device newdevice_
Attach mirror to device
detach pool device
Detach mirror device
replace pool old new
Replace disk in pool
online/offline pool device
Bring device online/offline

CAVEATS

Most operations require root privileges.
Pool destruction is permanent. zpool destroy deletes all data.
RAID-Z cannot be expanded by adding disks to an existing vdev (as of OpenZFS 2.2, expansion is possible on some platforms).
Regular scrubs are critical. ZFS detects but cannot repair single-disk pool errors.

SEE ALSO

zfs(8), zdb(8), zpool-status(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community