diff --git a/app/gather_info.sh b/app/gather_info.sh
index d6c074e..205efd5 100755
--- a/app/gather_info.sh
+++ b/app/gather_info.sh
@@ -103,28 +103,36 @@ if [ -n "$total_kb" ] && [ -n "$available_kb" ]; then
echo "available_mb=$available_mb"
fi
-# Physical disks
-lsblk -b -n -o NAME,SIZE,TYPE 2>/dev/null | while read -r name size type; do
- if [ "$type" = "disk" ]; then
- echo "[disk:$name]"
- echo "name=$name"
- echo "size_bytes=$size"
+# Physical disks and partitions
+lsblk -b -n -P -o NAME,SIZE,TYPE,MOUNTPOINT,PKNAME 2>/dev/null | while read -r line; do
+ eval "$line"
+ if [ "$TYPE" = "disk" ]; then
+ echo "[disk:$NAME]"
+ echo "name=$NAME"
+ echo "size_bytes=$SIZE"
+ elif [ "$TYPE" = "part" ]; then
+ echo "[partition:$NAME]"
+ echo "name=$NAME"
+ echo "size_bytes=$SIZE"
+ echo "parent=$PKNAME"
+ echo "mount=$MOUNTPOINT"
fi
done
-# Mounted filesystem usage
-df -B1 --output=target,size,used,avail,pcent 2>/dev/null | tail -n +2 | while read -r mount total used avail percent; do
+# Mounted filesystem usage (exclude virtual filesystems)
+df -B1 --output=target,size,used,avail,pcent \
+ -x tmpfs -x devtmpfs -x squashfs -x overlay -x efivarfs -x nsfs \
+ 2>/dev/null | tail -n +2 | while read -r mount total used avail percent; do
case "$mount" in
- /|/home|/var|/tmp|/boot|/data*|/mnt*|/srv*|/opt*)
- safename=$(echo "$mount" | tr '/' '_')
- echo "[disk_usage:${safename}]"
- echo "mount=$mount"
- echo "total_bytes=$total"
- echo "used_bytes=$used"
- echo "available_bytes=$avail"
- echo "usage_percent=${percent%\%}"
- ;;
+ /dev|/dev/*|/proc|/proc/*|/sys|/sys/*|/run|/run/*|/snap/*) continue ;;
esac
+ safename=$(echo "$mount" | tr '/' '_')
+ echo "[disk_usage:${safename}]"
+ echo "mount=$mount"
+ echo "total_bytes=$total"
+ echo "used_bytes=$used"
+ echo "available_bytes=$avail"
+ echo "usage_percent=${percent%\%}"
done
# GPUs
diff --git a/app/templates/index.html b/app/templates/index.html
index e5691f5..23d914d 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -296,21 +296,67 @@
Storage
{% set disks = d.get('disk', []) if d.get('disk') else [] %}
+ {% set partitions = d.get('partition', []) if d.get('partition') else [] %}
{% if disks %}
-
+
{% for disk in disks %}
- | {{ disk.get('name', '-') }} |
+ {{ disk.get('name', '-') }} |
+ |
{{ disk.get('size_bytes', '')|format_bytes }} |
+ | | |
+
+ {% for part in partitions if part.get('parent') == disk.get('name') %}
+ {% set part_mount = part.get('mount', '') %}
+ {% set ns = namespace(du=none) %}
+ {% for du in disk_usages if du.get('mount') == part_mount and part_mount %}
+ {% set ns.du = du %}
+ {% endfor %}
+
+ | {{ part.get('name', '-') }} |
+ {{ part_mount or '-' }} |
+ {{ part.get('size_bytes', '')|format_bytes }} |
+ {% if ns.du %}
+ {{ ns.du.get('used_bytes', '')|format_bytes }} |
+ {{ ns.du.get('available_bytes', '')|format_bytes }} |
+
+
+ {{ ns.du.get('usage_percent', '-') }}%
+
+ |
+ {% else %}
+ | | |
+ {% endif %}
{% endfor %}
+ {% endfor %}
+ {# Show any disk_usage entries not matched to a partition (e.g. NFS, LVM, ZFS) #}
+ {% for du in disk_usages %}
+ {% set ns = namespace(matched=false) %}
+ {% for part in partitions if part.get('mount') == du.get('mount') and part.get('mount') %}
+ {% set ns.matched = true %}
+ {% endfor %}
+ {% if not ns.matched %}
+
+ | {{ du.get('mount', '-') }} |
+ {{ du.get('mount', '-') }} |
+ {{ du.get('total_bytes', '')|format_bytes }} |
+ {{ du.get('used_bytes', '')|format_bytes }} |
+ {{ du.get('available_bytes', '')|format_bytes }} |
+
+
+ {{ du.get('usage_percent', '-') }}%
+
+ |
+
+ {% endif %}
+ {% endfor %}
- {% endif %}
-
- {% if disk_usages %}
-
-
+ {% elif disk_usages %}
+ {# Fallback: no lsblk data (e.g. containers), just show df data #}
+
+
{% for du in disk_usages %}
| {{ du.get('mount', '-') }} |