# 📘 ZFS Command Cheat Sheet ## 🛠️ Pool Management ### Create a Pool ```bash zpool create zpool create mirror zpool create raidz1 ... ``` ### List Pools ```bash zpool list ``` ### Destroy a Pool ```bash zpool destroy ``` ### Add Devices to a Pool ```bash zpool add ``` ### Export / Import Pool ```bash zpool export zpool import zpool import -d /dev/disk/by-id ``` ## 🔍 Pool Status and Health ### Check Pool Status ```bash zpool status zpool status -v ``` ### Scrub a Pool ```bash zpool scrub ``` ### Clear Errors ```bash zpool clear ``` ## 🧱 Dataset Management ### Create a Dataset ```bash zfs create / ``` ### List Datasets ```bash zfs list zfs list -t all ``` ### Destroy a Dataset ```bash zfs destroy / ``` ## 📦 Mounting and Properties ### Set Mount Point ```bash zfs set mountpoint=/your/path / ``` ### Mount / Unmount ```bash zfs mount zfs unmount ``` ### Auto Mount ```bash zfs set canmount=on|off|noauto ``` ## 📝 Snapshots & Clones ### Create a Snapshot ```bash zfs snapshot /@ ``` ### List Snapshots ```bash zfs list -t snapshot ``` ### Roll Back to Snapshot ```bash zfs rollback /@ ``` ### Destroy a Snapshot ```bash zfs destroy /@ ``` ### Clone a Snapshot ```bash zfs clone /@ / ``` ## 🔁 Sending & Receiving ### Send Snapshot to File or Pipe ```bash zfs send > file zfs send -R | zfs receive / ``` ### Receive Snapshot ```bash zfs receive / ``` ## 🧮 Useful Info & Tuning ### Check Available Space ```bash zfs list ``` ### Set Quota or Reservation ```bash zfs set quota=10G zfs set reservation=5G ``` ### Enable Compression ```bash zfs set compression=lz4 ``` ### Enable Deduplication (use cautiously) ```bash zfs set dedup=on ``` --- > ✅ **Tip**: Always test ZFS commands in a safe environment before using them on production systems!