Skip to main content

zfspace tool helps to analyze how zfs disk space is used

Project description

zfspace

Console tool to find occupied pool space in ZFS on Linux. The tool uses pure python3 with shell commands to collect useful information from ZFS and show it in convenient way wit recommendations how to free some space.

Introduction

ZFS is a non-trivial LVS filesystem with snapshots, reservations, deduplication, filesystems hierarchy and so on. Common tools, such as df or ls can't provide relevant information when you need to free some space. There is an explanatory article about this.

Snapshots USED space is another puzzle. ZFS only shows space freed by destroying individual snapshot or space occupied by all filesystem snapshots. If you add up all USED by the snapshots space, you will not get total occupied space because there is some space occupied by snapshot combinations. Most people do not comprehend this.

zfspace tries to analyze space usage and describe it in a human way with recommendations on the things you can do to free some space. The snapshot analysis is similar to this tool.

Installation

pip3 install zfspace zfspace doesn't require root priviledges as it is installed in ~/.local/bin/

Usage

Usage: zfspace [-h] [-V] [-f FILTER] dataset_name
Run zfspace -h to get more help
Example: zfspace mypool/root/

Compatibility

zfspace is pure python module installed by pip, so it might work on any Linux with Python3 and pip package manager. But zfspace has only been tested on Ubuntu 18.04 and Debian 10.

Development

  • You must obey PEP8 formatting rules written in .flake8
  • You must create new versions using bump2version. It simultaneously update several files with new version and place a version tag in repository.
    Example:
bump2version patch

or

bump2version minor
  • Packet release is based on pyproject.toml. First prepare your environment with:
pip3 install build

To build a packet use bump2version first and then go into project directory and run:

python3 -m build --wheel

Install manually (replace x.x.x with correct version) with:

pip install dist/zfspace-x.x.x-py3-none-any.whl --force-reinstall

Publishing notes

Twine packet must be installed

pip3 install twine

To publish:

twine upload dist/zfspace-x.x.x-py3-none-any.whl

You will be asked for login and password on PyPi.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zfspace-0.7.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file zfspace-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: zfspace-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9

File hashes

Hashes for zfspace-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fadf1c8b9b6f07e79285ce5e5dfb99a00677c41d49ee9739ef6bbe0e0ac725e
MD5 b7286b458e2732c307a4ba2e871424e8
BLAKE2b-256 b0a64af1236c050041da4b56486d6ee9d65345d2d76a616ea9077349118bfeb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page