From 34643a1d65987659d4ff9687828f4c0460ecc956 Mon Sep 17 00:00:00 2001 From: mehmetyavuzz43 <147098445+mehmetyavuzz43@users.noreply.github.com> Date: Mon, 22 Dec 2025 17:36:59 +0100 Subject: [PATCH] add datadir usage helper Helper script to inspect disk usage for the Base Reth data directory using BASE_RETH_DATADIR or /data/reth. --- reth/check_reth_datadir.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 reth/check_reth_datadir.sh diff --git a/reth/check_reth_datadir.sh b/reth/check_reth_datadir.sh new file mode 100644 index 00000000..38541816 --- /dev/null +++ b/reth/check_reth_datadir.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Small helper to inspect disk usage of a Base Reth data directory. +# +# This can be used before upgrades or when planning storage for a new node. +# +# Usage: +# BASE_RETH_DATADIR=/data/reth ./reth/check_reth_datadir.sh + +DATADIR="${BASE_RETH_DATADIR:-/data/reth}" + +if [ ! -d "${DATADIR}" ]; then + echo "[reth] Data directory does not exist:" + echo " ${DATADIR}" + echo + echo "Set BASE_RETH_DATADIR to the correct path before running this script." + exit 1 +fi + +echo "== Base Reth datadir disk usage ==" +echo "Path: ${DATADIR}" +echo + +if command -v du >/dev/null 2>&1; then + du -sh "${DATADIR}" + echo + echo "Top-level subdirectories:" + du -sh "${DATADIR}"/* 2>/dev/null | sort -h +else + echo "The 'du' command is not available on this system." +fi + +echo +echo "Tip: keep this directory on a fast local NVMe SSD for best performance."