From 717fcb9c81d2bc3cc7a84a3ebea6572d7ff0f5cf Mon Sep 17 00:00:00 2001 From: doc Date: Mon, 30 Jun 2025 20:06:28 +0000 Subject: uploading documentation --- cheatsheets/zfs_cheat_sheet.md | 153 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 cheatsheets/zfs_cheat_sheet.md (limited to 'cheatsheets/zfs_cheat_sheet.md') diff --git a/cheatsheets/zfs_cheat_sheet.md b/cheatsheets/zfs_cheat_sheet.md new file mode 100644 index 0000000..760aeb1 --- /dev/null +++ b/cheatsheets/zfs_cheat_sheet.md @@ -0,0 +1,153 @@ +# 📘 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! -- cgit v1.2.3