💾 Disk Usage Calculator

🔧 Calculator

📥 Paste du output

Supports human-readable (du -h ./foo) and raw-byte (du -B1 ./foo) formats — auto-detected by the first non-empty line.

📥 Paste df output

Accepts df, df -h, df -H, or df -B1. The header line and wrapped-filesystem lines are handled.

🗄️ RAID / RAIDZ configuration

🧱 Partition planner

Partitions

🔎 find -size query builder

📐 Humanize byte counts

Paste one or more byte counts (space/comma separated). IEC = 1024-based (GiB), SI = 1000-based (GB).

📊 Parsed tree

Total: {{ duTotalHuman }}
Paste du output on the left to see a parsed tree.
Size Path Share
{{ e.sizeHuman }} {{ e.path }}
Warnings:
  • {{ w }}

📊 Parsed filesystems

Paste df output on the left to see parsed filesystems.
Filesystem Size Used Avail Use% Mount
{{ f.filesystem }} {{ _humanize(f.sizeBytes, 'iec') }} {{ _humanize(f.usedBytes, 'iec') }} {{ _humanize(f.availableBytes, 'iec') }} {{ f.usePercent }}% {{ f.mountPoint }}

🗄️ RAID summary

Adjust the configuration to compute usable capacity.
Raw total: {{ raidTotalRawHuman }}
Usable: {{ raidUsableHuman }}
Overhead: {{ raidOverheadHuman }}
Tolerance: can lose {{ raidResult.faultTolerance }} disk(s) without data loss
Notes:
  • {{ w }}

🧱 Partition layout

Add partitions and set sizes to see the layout.
Total: {{ partitionTotalHuman }} — Leftover: {{ partitionLeftoverHuman }}
Name Size % Mount FS
{{ p.name }} {{ _humanize(p.sizeBytes, 'iec') }} {{ p.percent.toFixed(1) }}% {{ p.mountPoint }} {{ p.fileSystem }}
Warnings:
  • {{ w }}

🔎 Generated command

{{ findResult ? findResult.command : '# Configure the query on the left.' }}
Explanation:
  • {{ line }}

📐 Humanized output

{{ humanizeOutput || 'Paste byte counts on the left.' }}
⚠️

ℹ️ About Disk Usage Calculator

What this tool does

The Disk Usage Calculator bundles the six most common ad-hoc calculations sysadmins reach for when they are running out of space or planning a new array. It parses du(1) and df(1) output (both human-readable and raw-byte forms), computes usable capacity for RAID 0/1/5/6/10 and ZFS RAIDZ1/2/3, lays out a partition table from a target disk size, builds a find -size query, and humanizes byte counts in either IEC (1024-based) or SI (1000-based) units.

Everything runs entirely in the browser — paste your du -h or du -B1 output and you get a sortable tree without sending the path list to any server. The same TypeScript logic module powers the JSON API for headless use.

du / df / ncdu

  • du ("disk usage") reports the size of each directory tree. du -h prints human-readable suffixes (4.0K, 1.2G); du -B1 prints raw bytes for scripting.
  • df ("disk free") reports the size, used, and available bytes per mounted filesystem. df -h uses powers of 1024, df -H uses powers of 1000 to match drive vendor labels.
  • ncdu ("NCurses disk usage") is an interactive disk usage analyzer that exports the same data du produces; paste an ncdu -o JSON export elsewhere or copy a path list here.

RAID and RAIDZ capacity

  • RAID 0 — N×size, no redundancy. A single disk loss destroys the array.
  • RAID 1 — mirror, one disk worth of capacity regardless of count.
  • RAID 5 / RAIDZ1 — (N−1)×size, tolerates 1 disk loss. Single-parity is considered risky for large modern disks because rebuild times exceed reliable unrecoverable-read-error thresholds.
  • RAID 6 / RAIDZ2 — (N−2)×size, tolerates 2 disk losses. Recommended for arrays with disks > 4 TB.
  • RAID 10 — (N/2)×size, striped mirror; can tolerate one disk loss per mirror pair.
  • RAIDZ3 — (N−3)×size, tolerates 3 disk losses. For very large pools.

See RAID levels (Wikipedia) and the OpenZFS RAIDZ documentation for the underlying math.

find -size and tar size estimation

find -size filters by file size; common suffixes are c (bytes), k (KiB), M (MiB), and G (GiB). A leading + means "larger than"; a leading - means "smaller than". This builder produces a command you can paste straight into a shell:

find . -type f -size +500M -mtime -7

For tar archive size estimates, pipe a du -sb on the source path into the humanizer, or combine find -size with du -ch to estimate the compressed archive. The find(1) man page documents every operand this builder supports.

IEC vs SI units

  • IEC (binary) — 1 KiB = 1024 B. Used by Linux du -h, df -h, RAM sizing, filesystem reporting.
  • SI (decimal) — 1 KB = 1000 B. Used by drive vendors, network throughput, and df -H. A 1 TB disk is 1 000 000 000 000 bytes ≈ 931 GiB.
  • The humanize tab can output either form — useful for reconciling vendor-advertised capacity with df output.

See Binary prefix (Wikipedia) for the full IEC 80000-13 / IEC 60027-2 standard.

API Usage Example:

POST /api/tools/linux/disk-usage-calculator
Content-Type: application/json

{
    "operation": "raidCalculator",
    "input": {
        "level": "raid5",
        "diskCount": 4,
        "diskSizeBytes": 1099511627776
    }
}
Ready