ZFS: dedup toggle per pool and dedup option for new datasets
build / build (push) Successful in 1m4s
build / build (push) Successful in 1m4s
Pool cards show the dedup ratio and can set dedup=on|off on the pool root dataset (inherited by children); the new-dataset form gets a dedup option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<div><span class="muted">fragmentation</span> {{.FragPct}}%</div>
|
||||
<div><span class="muted">last scrub</span> {{if .LastScrub}}{{dtp .LastScrub}} ({{agop .LastScrub}}){{else}}never{{end}}</div>
|
||||
<div><span class="muted">errors</span> {{if .Errors}}{{.Errors}}{{else}}—{{end}}</div>
|
||||
<div><span class="muted">dedup</span> {{with index $.Data.PoolDedup .Name}}{{.}}{{else}}—{{end}}{{if .DedupRatio}} (ratio {{printf "%.2f" .DedupRatio}}x){{end}}</div>
|
||||
</div>
|
||||
<div class="bar"><span class="fill {{capClass .CapPct $.Data.Th.PoolCapacityPct 95}}" style="width:{{.CapPct}}%"></span></div>
|
||||
{{if .Scan}}<p class="small"><span class="muted">scan:</span> {{.Scan}}</p>{{end}}
|
||||
@@ -31,6 +32,21 @@
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table></div>
|
||||
{{$dedup := index $.Data.PoolDedup .Name}}
|
||||
<details class="dedup dedup-{{.Name}}">
|
||||
<summary>Deduplication</summary>
|
||||
<form method="post" action="/zfs/dedup" class="inline">
|
||||
<input type="hidden" name="pool" value="{{.Name}}">
|
||||
<label>Dedup for {{.Name}}
|
||||
<select name="dedup">
|
||||
<option value="off" {{if or (eq $dedup "off") (eq $dedup "")}}selected{{end}}>off</option>
|
||||
<option value="on" {{if and (ne $dedup "off") (ne $dedup "")}}selected{{end}}>on</option>
|
||||
</select>
|
||||
</label>
|
||||
<button type="submit">Apply</button>
|
||||
</form>
|
||||
<p class="small muted">Sets dedup on the pool root dataset; child datasets inherit it unless they override it. Only newly written data is deduplicated, and turning it off keeps the existing dedup table. The dedup table needs a lot of RAM (up to ~5 GB per 1 TB of unique data) — enable it only for data with many duplicate blocks.</p>
|
||||
</details>
|
||||
<details class="newds newds-{{.Name}}" {{if eq $form.Pool .Name}}open{{end}}>
|
||||
<summary>New dataset in {{.Name}}</summary>
|
||||
<form method="post" action="/zfs/create" class="ds-form">
|
||||
@@ -46,6 +62,13 @@
|
||||
<option value="off" {{if eq $form.Compression "off"}}selected{{end}}>off</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>Dedup
|
||||
<select name="dedup">
|
||||
<option value="" {{if eq $form.Dedup ""}}selected{{end}}>inherit</option>
|
||||
<option value="on" {{if eq $form.Dedup "on"}}selected{{end}}>on</option>
|
||||
<option value="off" {{if eq $form.Dedup "off"}}selected{{end}}>off</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>Quota <input name="quota" placeholder="none, or 100G / 1.5T" value="{{if eq $form.Pool .Name}}{{$form.Quota}}{{end}}"></label>
|
||||
</div>
|
||||
<p class="small muted">Creates {{.Name}}/<name> (parents are created too), mounts it at /{{.Name}}/<name> and chowns the mountpoint to the owner.</p>
|
||||
|
||||
Reference in New Issue
Block a user