| title | Getting Started |
|---|---|
| description | Install ZFSh and create your first ZFS pool |
This guide walks you through installing ZFSh and setting up your first ZFS pool.
- Linux with ZFS support (Debian, Ubuntu, Proxmox, etc.)
- Bash 4.0 or later
- Root privileges
If ZFS is not already installed:
# Debian/Ubuntu
apt update && apt install -y zfsutils-linux
# Verify installation
zfs --version# Progress bars for long operations
apt install -y pv
# Compression tools (zstd recommended)
apt install -y zstd gzip lz4git clone https://github.com/temasm/zfsh.git /opt/zfsh
cd /opt/zfsh
chmod +x zfsh *.sh
# Create symlink for global access
ln -s /opt/zfsh/zfsh /usr/local/bin/zfshcurl -L https://github.com/temasm/zfsh/archive/main.tar.gz | tar xz
mv zfsh-main /opt/zfsh
chmod +x /opt/zfsh/zfsh /opt/zfsh/*.sh
ln -s /opt/zfsh/zfsh /usr/local/bin/zfshzfsh --version
# Output: ZFSh v0.0.1Create a 50GB pool with compression and deduplication:
zfsh pool create default -s 50G -c zstd -d on -yExample output
======================================
Create ZFS Pool
======================================
[INFO] Creating sparse file: /var/lib/incus/disks/default.img (50G)
[OK] Sparse file created
[INFO] Creating ZFS pool: default
[OK] Pool created successfully
[INFO] Setting compression: zstd
[OK] Compression enabled
[INFO] Setting dedup: on
[OK] Deduplication enabled
[INFO] Enabling autotrim
[OK] Autotrim enabled
Pool 'default' created successfully!
Size: 50G
Compression: zstd
Dedup: on
Autotrim: on
Backend: /var/lib/incus/disks/default.img
zfsh pool info defaultExample output
======================================
ZFS Pool: default
======================================
Status
------
State: ONLINE
Health: ONLINE
Storage
-------
Total: 49.5G
Used: 780K (0%)
Free: 49.5G
Fragmentation: 0%
Dedup Ratio: 1.00x
Properties
----------
Compression: zstd
Dedup: on
Autotrim: on
Backend
-------
Type: file
Path: /var/lib/incus/disks/default.img
Actual Size: 516K (sparse)
If you plan to use Incus containers:
zfsh incus init -p default -yExample output
======================================
Incus Initialization with ZFS
======================================
Summary:
ZFS pool: default
Storage name: default
Network: incusbr0 (create new)
[INFO] Applying Incus configuration...
[OK] Incus initialized successfully
[INFO] Verifying setup...
[OK] Storage pool 'default' created
[OK] Network 'incusbr0' available
[OK] Default profile configured
Setup complete! You can now create containers:
incus launch images:debian/12 my-container
incus launch images:ubuntu/24.04 my-ubuntu
zfsh snapshot create defaultExample output
[INFO] Creating snapshot: default@backup_20260127_143022
[OK] Snapshot created: default@backup_20260127_143022
# Daily snapshots at 2:00 AM
zfsh cron add --type snapshot --pool default --daily
# Cleanup with retention policy
zfsh cron add --type cleanup --pool default --daily \
--keep-daily 7 --keep-weekly 4 --keep-monthly 3Now that you have a working ZFS setup, explore:
- Pool Management — Learn about pool health checks and expansion
- Snapshot Management — Master snapshot workflows
- Backup Strategy — Design your backup system
- Retention Policies — Understand GFS retention
zfsh pool health defaultzfsh snapshot list --pool defaultzfsh backup create default -c zstd# Add 20GB to the pool
zfsh pool expand default -a 20G -yInstall ZFS utilities:
apt install -y zfsutils-linux
modprobe zfsZFSh requires root privileges:
sudo zfsh pool create mypool -s 50GCheck available disk space before creating pools:
df -h /var/lib/incus/disks/# General help
zfsh --help
# Command-specific help
zfsh pool --help
zfsh snapshot --help
zfsh backup --help