A lightweight Go program that displays storage usage across multiple devices — including Android, tablets, ZyXEL NAS systems, and Cloud Environments (Google Cloud Shell, GitHub Codespaces) — with automatic detection of USB drives connected to ZyXEL NAS (/e-data).
This project preserves the original code structure while extending it with dynamic USB detection and cloud awareness.
- v1.5 Highlights:
- Google Cloud Storage (GCS): Support for
/dev/disk/by-id/google-home-part1used by gcloud. - Code Optimization: Improved directory traversal speed with
filepath.WalkDirand optimized size formatting. - Refined UI: Cleaner usage bars and more efficient storage detection.
- Google Cloud Storage (GCS): Support for
- v1.4 Highlights:
- Dynamic Bash Completion: Real-time suggestions for active drives and system paths.
- Cloud Awareness: Auto-detects Google Cloud Shell and GitHub Codespaces storage.
- HDD Detection: Specifically tracks ZyXEL HDD 1 and HDD 2 via
/i-data/mount points.
- Displays formatted storage information for:
- Redmi internal and SD card paths
- Android tablet storage
- ZyXEL NAS RAID volumes (
/dev/md0,/dev/md1) - Automatically detected USB drives in
/e-data
- Uses native
syscall.Statfsto gather disk stats (efficient and portable). - Shows color-coded bar charts with usage percentage.
- Designed to run on low-resource environments (ARMv5 ZyXEL NAS).
- ANSI color support for clean, readable terminal output.
- A list of known storage paths is defined (Android + ZyXEL HDDs + Cloud Home).
- The function
detectZyXELUSB()lists the/e-datadirectory to find all connected USB devices automatically. - Environment variables (
CLOUD_SHELL,CODESPACES) are checked to add cloud-specific workspaces. - Active paths are filtered for existence and uniqueness.
- For each storage path, disk statistics (Total, Used, Free) are retrieved.
- The information is displayed as a colored usage bar and numerical summary.
- Go 1.17+ (Builds tested with Go 1.19.3)
- Works on:
- Linux (x86 / ARM / ARMv5 / ARMv7)
- Android (via Termux)
- ZyXEL NAS with FFP (fonz_fun_plug)
- Google Cloud Shell / GitHub Codespaces
go run main.gogo build -o storage main.goGenerate and source the completion script to get TAB-suggestions for your disks:
source <(./storage -c)The included Makefile supports cross-compilation for various targets:
make zyxel- Build for ARMv5 (ZyXEL NAS)make redmi- Build for Android ARM64make native- Build for current hostmake install- Detect environment and install to bin path
Jonáš Nedvědický (PhateValleyman) Maintained as part of embedded utilities for ARM-based systems.