meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| linux:fs:zfs:shrink [2021/11/07 20:37] – created niziak | linux:fs:zfs:shrink [2024/02/16 07:49] (current) – niziak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== ZFS shrink pool ====== | + | ====== ZFS: resize zpool ====== | 
| - | Shrink  | + | ===== extend pool ===== | 
| + | |||
| + | Get device name used in pool: | ||
| + | <code bash> | ||
| + | zpool status nvmpool | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | # resize / | ||
| + | parted / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | resizepart 3 | ||
| + | End ? [X.XGB]? | ||
| + | quit | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | zpool online -e nvmpool nvme0n1p3 | ||
| + | </ | ||
| + | |||
| + | ====== ZFS: shrink zpool ====== | ||
| + | |||
| + | Shrinking of zpool is not possible, but trick with 2nd device (or even file) works: | ||
| * add 2nd device to zpool (can be smaller - only to fit data) | * add 2nd device to zpool (can be smaller - only to fit data) | ||
| * remove 1st device - zpool will copy all data to another device. | * remove 1st device - zpool will copy all data to another device. | ||
| - |   * to create mirror, use '' | + |   * to create mirror, use '' | 
| <code bash> | <code bash> | ||
| + | zpool list rpool -v | ||
| zpool offline rpool / | zpool offline rpool / | ||
| zpool detach rpool / | zpool detach rpool / | ||
| </ | </ | ||
| - | Resize / | + | Resize  | 
| <code bash> | <code bash> | ||
| Line 19: | Line 44: | ||
| </ | </ | ||
| - | Resize / | + | Sometimes ZFS refuse to remove device with 'out of space' error (but second device is capable to handle all data). To solve it, add more temporary devices to '' | 
| + | <code bash> | ||
| + | zfs create -V 64gb nvmpool/ | ||
| + | zfs create -V 64gb nvmpool/ | ||
| + | zpool add rpool / | ||
| + | zpool add rpool / | ||
| + | </ | ||
| + | |||
| + | Resize  | ||
| <code bash> | <code bash> | ||