Mirrored from
  • Rust 95.9%
  • Shell 4.1%
Find a file
kidev 617a05fbcd Fix delete confirmation safety, expand_all, tree lines, auto-refresh msg
- CRITICAL: confirm_delete was never reset when pressing other keys
  after 'd'. User could navigate, re-mark, press 'd' again and
  snapshots would be deleted without confirmation
- expand_all: only expanded currently visible datasets, not nested
  collapsed ones. Now recursively collects from root_entries
- is_last for snapshots: showed wrong tree connector when parent
  had both child datasets and snapshots (snapshots are always last)
- auto-refresh message hardcoded "30s" instead of config value
2026-02-20 20:34:59 +01:00
releases Fix delete confirmation safety, expand_all, tree lines, auto-refresh msg 2026-02-20 20:34:59 +01:00
src Fix delete confirmation safety, expand_all, tree lines, auto-refresh msg 2026-02-20 20:34:59 +01:00
.gitignore Initial commit: zfsdu v0.1.0 - ZFS disk usage viewer with snapshot management 2026-01-30 23:20:00 +01:00
Cargo.toml Fix search highlight indices after tree rebuild (v0.2.2) 2026-02-17 08:55:11 +01:00
install-binary.sh Initial commit: zfsdu v0.1.0 - ZFS disk usage viewer with snapshot management 2026-01-30 23:20:00 +01:00
install.sh Initial commit: zfsdu v0.1.0 - ZFS disk usage viewer with snapshot management 2026-01-30 23:20:00 +01:00
LICENSE Initial commit: zfsdu v0.1.0 - ZFS disk usage viewer with snapshot management 2026-01-30 23:20:00 +01:00
README.md Add scope-based selection and credits 2026-01-31 00:15:26 +01:00

zfsdu - ZFS Disk Usage

A ncdu-like TUI application for ZFS with snapshot management. Navigate your ZFS pools, datasets, and volumes in a tree view, and manage snapshots interactively.

License

Quick Install

curl -sSL https://gitlab.datazone.de/kidev/zfsdu/-/raw/main/install-binary.sh | sudo bash

Features

  • Tree View: Hierarchical display of ZFS pools, datasets, and volumes
  • Expand/Collapse: Navigate the tree structure interactively
  • Snapshot Management: Mark and delete multiple snapshots at once
  • Size Visualization: Bar graphs showing relative sizes
  • Date Column: Shows creation date of datasets and snapshots
  • Search: Find datasets or snapshots by name
  • Filter: Filter the view to show only matching items
  • Bulk Selection: Select/unselect all visible snapshots (like Midnight Commander)
  • Sorting: Toggle between Size/Date/Name sorting
  • Dry-Run Mode: Preview deletions without actually deleting
  • Auto-Refresh: Automatically refresh the view periodically
  • Mouse Support: Click to select, scroll wheel to navigate, right-click to mark
  • Configurable Colors: Customize the UI via config file
  • MC-Style UI: Classic Midnight Commander look and feel

Screenshot

 zfsdu [Sort: Size]
┌─────────────────────────────────────────────────────────────────────────────┐
│ Name                                             Date          Size         │
│─────────────────────────────────────────────────────────────────────────────│
│ ▾ rpool                                      2024-01-01      500.0G  █████  │
│  ├──▾ ROOT                                   2024-01-01      120.0G  ██     │
│  │   ├── pve-1                               2024-01-15       80.0G  █      │
│  │   └──○ @autosnap_2024-01-15               2024-01-15       12.0G         │
│  └──▸ data                                   2024-01-01      380.0G  ████   │
│ ▸ tank                                       2023-12-01        2.0T  █████  │
├─────────────────────────────────────────────────────────────────────────────┤
│ 2 marked (45.5G)                                                            │
└─────────────────────────────────────────────────────────────────────────────┘
 ? Help  s Sort  D Dry  a Auto  / Find  f Filt  d Del  q Quit

Installation

curl -sSL https://gitlab.datazone.de/kidev/zfsdu/-/raw/main/install-binary.sh | sudo bash

Build from Source

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env

# Clone and build
git clone https://gitlab.datazone.de/kidev/zfsdu.git
cd zfsdu
cargo build --release

# Install
sudo cp target/release/zfsdu /usr/local/bin/

Usage

zfsdu

Keyboard Shortcuts

Key Action
Navigation
↑/k, ↓/j Move up/down
Enter/→/l Expand/collapse dataset
Home/End First/last item
PgUp/PgDn Page up/down
Mouse scroll Scroll list
Left-click Select item
Right-click Toggle mark
Tree
e Expand all
c Collapse all
Selection (current scope)
Space Mark/unmark snapshot
+ Select all in scope
- Unselect all in scope
* Invert selection in scope
Search & Filter
/ Search (n=next, N=prev)
f Filter visible items
Esc Clear filter
Sort & View
s Toggle sort: Size/Date/Name
D Toggle dry-run mode
a Toggle auto-refresh (30s)
Actions
d / F8 Delete marked snapshots (2x to confirm)
r / F5 Refresh
? / F1 Help
q / F10 Quit

Configuration

Create ~/.config/zfsdu/config.toml to customize colors:

# Auto-refresh interval in seconds (0 to disable)
auto_refresh_interval = 30

[colors]
# Available: black, red, green, yellow, blue, magenta, cyan, white
# Light: lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan
# Also: gray, darkgray

background = "blue"
foreground = "white"
header = "yellow"
selected_bg = "cyan"
selected_fg = "black"
marked = "yellow"
snapshot = "lightcyan"
size = "lightgreen"
tree = "darkgray"
search_match = "lightred"

Requirements

  • Linux with ZFS installed
  • Terminal with UTF-8 support
  • Root privileges (for snapshot deletion)

Author

Florian Schermer DATAZONE GmbH

License

CDDL (Common Development and Distribution License) - same as OpenZFS.

See LICENSE for details.