RAID Calculator

Wait 5 sec.

RAID level RAID 0 (striping) RAID 1 (mirror) RAID 5 (single parity) RAID 6 (double parity) RAID 10 (striped mirrors) ZFS mirror RAIDZ1 RAIDZ2 RAIDZ3 Number of drives Drive sizes All the same Mixed Drive capacity TB GB Drive class Consumer (URE 1 in 10&sup1;&#8308;) NAS / enterprise (URE 1 in 10&sup1;&#8309;) Usable capacity - Fault tolerance - Storage efficiency - Usable Parity/mirror Unused (mixed sizes) Real-world ZFS usable space is typically 3&ndash;8% lower than this figure due to metadata, padding, and the pool's built-in reservation. Treat this as an upper bound. Compare layouts Same drives, different layouts. This is usually the decision that matters most. Power, save & share Estimated power draw 3.5" HDD 2.5" HDD 2.5" SATA SSD NVMe SSD Save this configuration Save Share this configuration Copy link Copied #ifs-raid-calc{ /* Accent comes from Ghost's own injected accent color, so the widget always matches Settings > Design > Brand without any edits here. */ --rc-accent:var(--ghost-accent-color,#0a8a81); --rc-usable:var(--ghost-accent-color,#0a8a81); --rc-parity:#7d8ea6; --rc-waste:#d9822b; --rc-ok:#1d9d63;--rc-warn:#d9822b;--rc-bad:#d64545; /* One control height for inputs, selects and toggles so rows line up */ --rc-h:2.6em; /* Neutrals are translucent mixes of the page's own text color, so the widget adapts to light and dark automatically. rgba lines are the fallback for browsers without color-mix support. */ --rc-border:rgba(128,128,128,.35); --rc-soft:rgba(128,128,128,.09); --rc-softer:rgba(128,128,128,.05); --rc-muted:rgba(128,128,128,.95); --rc-accent-soft:rgba(10,138,129,.08); font-family:inherit;font-size:16px;line-height:1.55;color:inherit; color-scheme:light;max-width:100%;margin:1.5em 0;}@supports (color:color-mix(in srgb,red 50%,blue)){ #ifs-raid-calc{ --rc-border:color-mix(in srgb,currentColor 22%,transparent); --rc-soft:color-mix(in srgb,currentColor 6%,transparent); --rc-softer:color-mix(in srgb,currentColor 3.5%,transparent); --rc-muted:color-mix(in srgb,currentColor 66%,transparent); --rc-accent-soft:color-mix(in srgb,var(--rc-accent) 9%,transparent); }}.dark #ifs-raid-calc{color-scheme:dark}#ifs-raid-calc *{box-sizing:border-box}#ifs-raid-calc [hidden]{display:none !important}#ifs-raid-calc .rc-panel{background:var(--rc-softer);border:1px solid var(--rc-border); border-radius:10px;padding:1.1em 1.2em;margin-bottom:1em}#ifs-raid-calc .rc-inputs{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:.9em;align-items:end;background:var(--rc-soft)}#ifs-raid-calc label,#ifs-raid-calc .rc-label{display:block;font-size:.82em;font-weight:600;margin-bottom:.35em; color:var(--rc-muted);text-transform:uppercase;letter-spacing:.04em}/* The theme gives every input a margin, padding and box-shadow border; reset them here */#ifs-raid-calc select,#ifs-raid-calc input[type=number],#ifs-raid-calc input[type=text]{ display:block;width:100%;height:var(--rc-h);margin:0;padding:0 .6em;font-size:1em;font-family:inherit; line-height:1.4;color:inherit;background:transparent;border:1px solid var(--rc-border); border-radius:7px;box-shadow:none}#ifs-raid-calc select:focus-visible,#ifs-raid-calc input:focus-visible,#ifs-raid-calc button:focus-visible{ outline:2px solid var(--rc-accent);outline-offset:1px}#ifs-raid-calc .rc-size-row{display:flex;align-items:flex-start;gap:.5em}#ifs-raid-calc .rc-size-row > input{flex:1;min-width:0}/* Segmented toggle, used for TB/GB and same/mixed sizes */#ifs-raid-calc .rc-toggle{display:flex;height:var(--rc-h);border:1px solid var(--rc-border); border-radius:7px;overflow:hidden;flex:none}#ifs-raid-calc .rc-opt{display:flex;align-items:center;justify-content:center;height:100%;margin:0; padding:0 .9em;border:0;border-radius:0;background:transparent;color:var(--rc-muted); font-family:inherit;font-size:.9em;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer}#ifs-raid-calc .rc-opt + .rc-opt{border-left:1px solid var(--rc-border)}#ifs-raid-calc .rc-opt:hover{color:inherit;background:var(--rc-soft)}#ifs-raid-calc .rc-opt.is-active{background:var(--rc-accent);color:#fff}#ifs-raid-calc .rc-toggle-full .rc-opt{flex:1}/* Mixed sizes: the capacity field spans the panel and shows one input per drive */#ifs-raid-calc .rc-field-size.is-mixed{grid-column:1/-1}#ifs-raid-calc .rc-field-size.is-mixed #rc-size{display:none}#ifs-raid-calc .rc-field-size.is-mixed .rc-toggle{order:-1}#ifs-raid-calc .rc-mixed-grid{flex:1;min-width:0;display:grid; grid-template-columns:repeat(auto-fill,minmax(100px,130px));gap:.5em}#ifs-raid-calc .rc-drive{position:relative}#ifs-raid-calc .rc-drive span{position:absolute;left:.6em;top:50%;transform:translateY(-50%); font-size:.78em;font-weight:600;color:var(--rc-muted);pointer-events:none}#ifs-raid-calc .rc-mixed-grid input[type=number]{padding-left:2.3em}#ifs-raid-calc .rc-error{border:1px solid var(--rc-bad);color:var(--rc-bad);background:var(--rc-softer); border-radius:8px;padding:.7em .9em;margin-bottom:1em;font-size:.95em}#ifs-raid-calc .rc-waste-note{border:1px solid var(--rc-waste);background:var(--rc-softer); border-radius:8px;padding:.7em .9em;margin-bottom:1em;font-size:.95em}#ifs-raid-calc .rc-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1em;margin-bottom:1em}#ifs-raid-calc .rc-stat-label{display:block;font-size:.78em;font-weight:600;text-transform:uppercase; letter-spacing:.05em;color:var(--rc-muted)}#ifs-raid-calc .rc-stat-value{display:block;font-size:1.7em;font-weight:700;line-height:1.25}#ifs-raid-calc .rc-stat-sub{display:block;font-size:.83em;color:var(--rc-muted)}#ifs-raid-calc .rc-bar{display:flex;height:34px;border-radius:8px;overflow:hidden;border:1px solid var(--rc-border)}#ifs-raid-calc .rc-bar-seg{transition:width .35s ease;min-width:0}#ifs-raid-calc .rc-seg-usable{background:var(--rc-usable)}#ifs-raid-calc .rc-seg-parity{background:var(--rc-parity)}#ifs-raid-calc .rc-seg-waste{background:var(--rc-waste)}#ifs-raid-calc .rc-legend{display:flex;flex-wrap:wrap;gap:.4em 1.2em;font-size:.85em;color:var(--rc-muted);margin:.5em 0 0}#ifs-raid-calc .rc-dot{display:inline-block;width:.7em;height:.7em;border-radius:2px;margin-right:.3em}#ifs-raid-calc .rc-dot-usable{background:var(--rc-usable)}#ifs-raid-calc .rc-dot-parity{background:var(--rc-parity)}#ifs-raid-calc .rc-dot-waste{background:var(--rc-waste)}#ifs-raid-calc .rc-zfs-note{font-size:.85em;color:var(--rc-muted);margin-top:.7em; border-left:3px solid var(--rc-parity);padding-left:.7em}#ifs-raid-calc .rc-explain{margin:1em 0 0;font-size:1em}#ifs-raid-calc .rc-risk{display:flex;align-items:flex-start;gap:.6em;margin-top:.9em;font-size:.95em}#ifs-raid-calc .rc-risk-badge{flex:none;font-size:.72em;font-weight:700;text-transform:uppercase; letter-spacing:.04em;color:#fff;padding:.2em .6em;border-radius:99px;margin-top:.2em}#ifs-raid-calc .rc-risk-low .rc-risk-badge{background:var(--rc-ok)}#ifs-raid-calc .rc-risk-med .rc-risk-badge{background:var(--rc-warn)}#ifs-raid-calc .rc-risk-high .rc-risk-badge{background:var(--rc-bad)}#ifs-raid-calc .rc-h3{font-size:1.05em;font-family:inherit;margin:0}#ifs-raid-calc .rc-compare-head{display:flex;flex-wrap:wrap;justify-content:space-between; align-items:center;gap:.6em;margin-bottom:.9em}#ifs-raid-calc .rc-compare-selects{display:flex;gap:.5em}#ifs-raid-calc .rc-compare-selects select{width:auto;font-size:.9em;padding:0 .5em}#ifs-raid-calc .rc-compare-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.8em}#ifs-raid-calc .rc-cmp-card{border:1px solid var(--rc-border);border-radius:8px;padding:.8em .9em;background:var(--rc-softer)}#ifs-raid-calc .rc-cmp-card.is-current{border-color:var(--rc-accent);background:var(--rc-accent-soft)}#ifs-raid-calc .rc-cmp-title{font-weight:700;margin-bottom:.4em}#ifs-raid-calc .rc-cmp-row{display:flex;justify-content:space-between;gap:.5em;font-size:.88em;padding:.15em 0}#ifs-raid-calc .rc-cmp-row span:first-child{color:var(--rc-muted)}#ifs-raid-calc .rc-cmp-row span:last-child{text-align:right}#ifs-raid-calc .rc-cmp-bar{display:flex;height:8px;border-radius:4px;overflow:hidden;margin:.5em 0 .2em}#ifs-raid-calc .rc-compare-foot{font-size:.83em;color:var(--rc-muted);margin:.8em 0 0}#ifs-raid-calc .rc-cmp-invalid{font-size:.85em;color:var(--rc-muted);font-style:italic}#ifs-raid-calc .rc-plus{border-color:var(--rc-border)}#ifs-raid-calc .rc-plus-head{display:flex;align-items:center;gap:.5em;margin-bottom:.8em}#ifs-raid-calc .rc-plus-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:1em}#ifs-raid-calc .rc-power{margin:.6em 0 0;padding:0;font-size:.9em}#ifs-raid-calc .rc-power div{display:flex;justify-content:space-between;align-items:baseline;gap:.75em; padding:.4em 0;border-bottom:1px solid var(--rc-border)}#ifs-raid-calc .rc-power div:last-child{border-bottom:0}#ifs-raid-calc .rc-power dt{margin:0;font-weight:400;color:var(--rc-muted)}#ifs-raid-calc .rc-power dd{margin:0;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}#ifs-raid-calc .rc-btn{display:inline-block;border:0;border-radius:7px;background:var(--rc-accent); color:#fff;font-family:inherit;font-size:.9em;font-weight:600;padding:.55em 1em;cursor:pointer}#ifs-raid-calc .rc-btn:hover{filter:brightness(1.08)}#ifs-raid-calc .rc-btn-ghost{background:transparent;color:var(--rc-accent);border:1px solid var(--rc-accent)}#ifs-raid-calc .rc-saved-list{list-style:none;margin:.6em 0 0;padding:0;font-size:.9em}#ifs-raid-calc .rc-saved-list li{display:flex;justify-content:space-between;align-items:center; gap:.5em;padding:.35em 0;border-bottom:1px solid var(--rc-border)}#ifs-raid-calc .rc-saved-list button{background:none;border:0;color:var(--rc-accent); font-family:inherit;cursor:pointer;font-size:.85em;padding:.2em .35em}#ifs-raid-calc .rc-share-row{display:flex;gap:.5em;margin-top:.5em;flex-wrap:wrap}#ifs-raid-calc .rc-share-row input{flex:1;min-width:0}#ifs-raid-calc .rc-copied{font-size:.85em;color:var(--rc-ok);align-self:center}@media (prefers-reduced-motion:reduce){#ifs-raid-calc .rc-bar-seg{transition:none}}@media (max-width:520px){ #ifs-raid-calc .rc-stat-value{font-size:1.35em} #ifs-raid-calc .rc-compare-selects{width:100%} #ifs-raid-calc .rc-compare-selects select{flex:1}}(function(){ 'use strict'; var $ = function(id){ return document.getElementById(id); }; /* ---------- Level definitions ---------- */ var LEVELS = { raid0: {name:'RAID 0', group:'raid', min:2, even:false, parityDrives:function(n){return 0;}, ft:function(n){return {n:0, note:'One drive failure destroys the whole array.'};}, mirror:false}, raid1: {name:'RAID 1', group:'raid', min:2, even:false, parityDrives:function(n){return n-1;}, ft:function(n){return {n:n-1, note:'Survives as long as one drive remains.'};}, mirror:true}, raid5: {name:'RAID 5', group:'raid', min:3, even:false, parityDrives:function(n){return 1;}, ft:function(n){return {n:1, note:'Any single drive can fail.'};}, mirror:false}, raid6: {name:'RAID 6', group:'raid', min:4, even:false, parityDrives:function(n){return 2;}, ft:function(n){return {n:2, note:'Any two drives can fail.'};}, mirror:false}, raid10: {name:'RAID 10', group:'raid', min:4, even:true, parityDrives:function(n){return n/2;}, ft:function(n){return {n:1, note:'1 guaranteed, up to '+(n/2)+' if failures land in different mirror pairs.'};}, mirror:true}, zmirror:{name:'ZFS mirror', group:'zfs', min:2, even:false, parityDrives:function(n){return n-1;}, ft:function(n){return {n:n-1, note:'An n-way mirror survives until the last copy.'};}, mirror:true}, raidz1: {name:'RAIDZ1', group:'zfs', min:3, even:false, parityDrives:function(n){return 1;}, ft:function(n){return {n:1, note:'Any single drive can fail.'};}, mirror:false}, raidz2: {name:'RAIDZ2', group:'zfs', min:4, even:false, parityDrives:function(n){return 2;}, ft:function(n){return {n:2, note:'Any two drives can fail.'};}, mirror:false}, raidz3: {name:'RAIDZ3', group:'zfs', min:5, even:false, parityDrives:function(n){return 3;}, ft:function(n){return {n:3, note:'Any three drives can fail.'};}, mirror:false} }; /* Power constants (typical figures; replace with It's FOSS benchmark data when available) */ var POWER_W = { hdd35:{label:'3.5" HDD', w:6.5}, hdd25:{label:'2.5" HDD', w:2.5}, ssd25:{label:'2.5" SATA SSD', w:2.0}, nvme:{label:'NVMe SSD', w:4.0} }; var ANCHOR_MAP = { 'raid-0-calculator':'raid0','raid-1-calculator':'raid1', 'raid-5-calculator':'raid5','raid-6-calculator':'raid6','raid-10-calculator':'raid10', 'zfs-raid-calculator':'raidz2','raidz1-calculator':'raidz1','raidz2-calculator':'raidz2', 'raidz3-calculator':'raidz3','zfs-mirror-calculator':'zmirror' }; var state = { level:'raid5', n:4, unit:'tb', size:4, mixed:false, sizes:[], ure:1e14, driveType:'hdd35' }; /* ---------- Math ---------- */ function effectiveSizes(){ if (state.mixed){ var s = state.sizes.slice(0, state.n); while (s.length < state.n) s.push(state.size); return s; } var arr = []; for (var i=0;i= 1) return (Math.round(tb*100)/100)+' TB'; return Math.round(tb*1000)+' GB'; } function toTiB(tb){ return tb*1e12/Math.pow(1024,4); } function compute(level, sizesTB){ var L = LEVELS[level], n = sizesTB.length; var out = { level:level, valid:true, error:null }; if (n < L.min){ out.valid=false; out.error=L.name+' needs at least '+L.min+' drives.'; return out; } if (L.even && n%2!==0){ out.valid=false; out.error='RAID 10 needs an even number of drives.'; return out; } var eff = Math.min.apply(null, sizesTB); var raw = sizesTB.reduce(function(a,b){return a+b;},0); var usedRaw = n*eff; var usable = (n - L.parityDrives(n)) * eff; out.eff = eff; out.raw = raw; out.waste = raw - usedRaw; out.usable = usable; out.overhead = usedRaw - usable; out.efficiency = usable / raw; out.ft = L.ft(n); out.n = n; out.name = L.name; out.isZfs = L.group==='zfs'; out.mirror = L.mirror; return out; } /* Rebuild risk: P(URE during rebuild) = 1 - exp(-bitsRead / ureRate) Parity arrays read all surviving drives; mirrors read one drive. */ function rebuildRisk(r){ if (!r.valid || r.level==='raid0') return null; var readTB = r.mirror ? r.eff : (r.n-1)*r.eff; var p = 1 - Math.exp(-(readTB*8e12)/state.ure); var tier, mode; if (r.level==='raid5' || r.level==='raidz1'){ /* no redundancy left during rebuild, the classic URE problem */ tier = p < 0.10 ? 'low' : (p < 0.50 ? 'med' : 'high'); mode = 'parity1'; } else if (r.mirror){ /* copy one drive; a URE costs sectors, not the array */ tier = p < 0.50 ? 'low' : 'med'; mode = 'mirror'; } else { /* raid6/raidz2/raidz3: remaining parity corrects read errors */ tier = 'low'; mode = 'parity2'; } return { p:p, readTB:readTB, tier:tier, mode:mode }; } /* ---------- Explanations ---------- */ function explain(r){ if (!r.valid) return ''; var u = fmtTB(r.usable), n = r.n, e = fmtTB(r.eff); switch(r.level){ case 'raid0': return 'RAID 0 stripes data across all '+n+' drives with no redundancy. You get the full '+u+' and the best speed, but if any single drive fails, everything is gone. Use it only for data you can afford to lose completely: scratch space, caches, or re-downloadable media.'; case 'raid1': return 'RAID 1 keeps an identical copy of your data on every drive. With '+n+' drives of '+e+', you get '+u+' of usable space and can lose all but one drive without losing data. It is the simplest safe setup for 2-drive NAS boxes, at the cost of storage efficiency.'; case 'raid5': return 'RAID 5 spreads data plus one set of parity across '+n+' drives, giving you '+u+' while tolerating one drive failure. It was the classic balance of capacity and safety, but with today&rsquo;s large drives, the long rebuild after a failure is its weak point. See the rebuild risk note below before choosing it over RAID 6.'; case 'raid6': return 'RAID 6 works like RAID 5 but stores two independent sets of parity, so any two of your '+n+' drives can fail. You give up one extra drive of capacity (leaving '+u+') in exchange for surviving a second failure during a rebuild, which is exactly when drives are most stressed. For large-capacity arrays, this trade is usually worth it.'; case 'raid10': return 'RAID 10 pairs drives into mirrors and stripes across the pairs. Your '+n+' drives become '+(n/2)+' mirrored pairs with '+u+' usable. Rebuilds are fast and gentle (only one drive is copied), and performance is excellent. The trade-off is that only 50% of raw capacity is usable and a second failure in the same pair is fatal.'; case 'zmirror': return 'A ZFS mirror keeps a full copy of your data on each of the '+n+' drives, with ZFS checksums verifying every block. You get '+u+' usable, fast resilvers, and the easiest expansion path in ZFS (add another mirror vdev later). It is what most ZFS veterans recommend for home setups unless you need maximum capacity.'; case 'raidz1': return 'RAIDZ1 is ZFS&rsquo;s single-parity layout: '+n+' drives give you roughly '+u+' and tolerance for one failure. ZFS checksums mean a read error during resilver corrupts a file, not the whole pool. That makes it safer than traditional RAID 5, but with large drives most ZFS users still prefer RAIDZ2&rsquo;s second parity.'; case 'raidz2': return 'RAIDZ2 stores two parity blocks per stripe, so any two of your '+n+' drives can fail without data loss, leaving roughly '+u+' usable. It is the default recommendation for 4 to 10 drive ZFS pools built on large drives: enough redundancy to survive a failure during the long resilver window.'; case 'raidz3': return 'RAIDZ3 uses triple parity, so any three of your '+n+' drives can fail. With roughly '+u+' usable it is aimed at wide pools (11+ drives) or setups where replacing a drive takes days. For most home labs it is more redundancy than you need; RAIDZ2 usually hits the better balance.'; } return ''; } /* ---------- Rendering ---------- */ function render(){ var sizes = effectiveSizes().map(toTB); var r = compute(state.level, sizes); var err = $('rc-error'); if (!r.valid){ err.textContent = r.error; err.hidden = false; $('rc-results').style.opacity = .4; renderCompare(sizes); return; } err.hidden = true; $('rc-results').style.opacity = 1; /* mixed-size waste callout */ var wn = $('rc-waste-note'); if (r.waste > 0.001){ wn.innerHTML = 'Smallest-drive rule: every drive is treated as '+fmtTB(r.eff)+ ' (your smallest). '+fmtTB(r.waste)+' of raw capacity sits unused. '+ 'Replacing the smallest drive is usually the cheapest upgrade.'; wn.hidden = false; } else wn.hidden = true; $('rc-usable').textContent = fmtTB(r.usable); $('rc-usable-tib').textContent = '&asymp; '+(Math.round(toTiB(r.usable)*100)/100)+' TiB as your OS reports it'; $('rc-ft').textContent = r.ft.n===0 ? 'None' : r.ft.n+' drive'+(r.ft.n>1?'s':''); $('rc-ft-note').textContent = r.ft.note; $('rc-eff').textContent = Math.round(r.efficiency*100)+'%'; $('rc-raw').textContent = 'of '+fmtTB(r.raw)+' raw'; var total = r.raw; $('rc-seg-usable').style.width = (r.usable/total*100)+'%'; $('rc-seg-parity').style.width = (r.overhead/total*100)+'%'; $('rc-seg-waste').style.width = (r.waste/total*100)+'%'; $('rc-parity-word').textContent = r.mirror ? 'Mirror copies' : (r.level==='raid0' ? 'Overhead (none)' : 'Parity'); $('rc-legend-waste').hidden = !(r.waste > 0.001); $('rc-zfs-note').hidden = !r.isZfs; $('rc-explain').textContent = explain(r); var risk = rebuildRisk(r), rk = $('rc-risk'); if (risk){ rk.hidden = false; rk.className = 'rc-risk rc-risk-'+risk.tier; $('rc-risk-badge').textContent = risk.tier==='low' ? 'Low risk' : (risk.tier==='med' ? 'Caution' : 'High risk'); var pct = risk.p < 0.01 ? '