A ncdu
-like TUI for the Ceph File System. Uses the rbytes
and rentries
xattrs to display directory sizes and file counts without walking the file system.
ncdu
and similar applications that display disk usage work by crawling the filesystem (walking the directory tree) and recursively adding up file sizes and counts. On most filesystems, there's no alternative. However, the Ceph File System stores the recursive bytes and recursive counts (ceph.dir.rbytes
and ceph.dir.rentries
) as "extended attributes", available with the getxattr
syscall. This means we can get disk usage info without a potentially expensive crawl.
cephdu consists of a single binary, compiled from Rust. The binary can be downloaded from a release or built from source.
Binaries are attached to each GitHub Release: https://github.com/flatironinstitute/cephdu/releases
To build and run with a Rust toolchain installed, from inside the repo run:
cargo run
To build an executable (dynamically linked by default):
cargo build --release
To build an executable that contains a default path to use if one is not given:
CEPHDU_DEFAULT_DIR=/mnt/ceph/users/\$USER cargo build --release
The literal string $USER
is substituted at runtime.
To build a static executable:
cargo build --release cargo build --target=x86_64-unknown-linux-musl
Simply run cephdu
from the command line and an interactive terminal user interface (TUI) will be displayed. Navigate using the arrow keys and Enter. For a full list of keyboard shortcuts, press ?
.
The CLI accepts one optional argument, the initial directory:
❯ cephdu --help
Display ceph space and file count (inode) usage in an interactive terminal
Usage: cephdu [PATH]
Arguments:
[PATH] Path to the directory to display
Options:
-h, --help Print help
MIT