meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:fs:zfs:shrink [2021/11/30 11:20] – 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. | ||
| Line 18: | Line 42: | ||
| zpool add rpool / | zpool add rpool / | ||
| zpool remove rpool / | zpool remove rpool / | ||
| + | </ | ||
| + | |||
| + | 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/t1 | ||
| + | zfs create -V 64gb nvmpool/t2 | ||
| + | zpool add rpool / | ||
| + | zpool add rpool / | ||
| </ | </ | ||