1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00
freebsd/scripts
Don Brady 5caeef02fa
RAID-Z expansion feature
This feature allows disks to be added one at a time to a RAID-Z group,
expanding its capacity incrementally.  This feature is especially useful
for small pools (typically with only one RAID-Z group), where there
isn't sufficient hardware to add capacity by adding a whole new RAID-Z
group (typically doubling the number of disks).

== Initiating expansion ==

A new device (disk) can be attached to an existing RAIDZ vdev, by
running `zpool attach POOL raidzP-N NEW_DEVICE`, e.g. `zpool attach tank
raidz2-0 sda`.  The new device will become part of the RAIDZ group.  A
"raidz expansion" will be initiated, and the new device will contribute
additional space to the RAIDZ group once the expansion completes.

The `feature@raidz_expansion` on-disk feature flag must be `enabled` to
initiate an expansion, and it remains `active` for the life of the pool.
In other words, pools with expanded RAIDZ vdevs can not be imported by
older releases of the ZFS software.

== During expansion ==

The expansion entails reading all allocated space from existing disks in
the RAIDZ group, and rewriting it to the new disks in the RAIDZ group
(including the newly added device).

The expansion progress can be monitored with `zpool status`.

Data redundancy is maintained during (and after) the expansion.  If a
disk fails while the expansion is in progress, the expansion pauses
until the health of the RAIDZ vdev is restored (e.g. by replacing the
failed disk and waiting for reconstruction to complete).

The pool remains accessible during expansion.  Following a reboot or
export/import, the expansion resumes where it left off.

== After expansion ==

When the expansion completes, the additional space is available for use,
and is reflected in the `available` zfs property (as seen in `zfs list`,
`df`, etc).

Expansion does not change the number of failures that can be tolerated
without data loss (e.g. a RAIDZ2 is still a RAIDZ2 even after
expansion).

A RAIDZ vdev can be expanded multiple times.

After the expansion completes, old blocks remain with their old
data-to-parity ratio (e.g. 5-wide RAIDZ2, has 3 data to 2 parity), but
distributed among the larger set of disks.  New blocks will be written
with the new data-to-parity ratio (e.g. a 5-wide RAIDZ2 which has been
expanded once to 6-wide, has 4 data to 2 parity).  However, the RAIDZ
vdev's "assumed parity ratio" does not change, so slightly less space
than is expected may be reported for newly-written blocks, according to
`zfs list`, `df`, `ls -s`, and similar tools.

Sponsored-by: The FreeBSD Foundation
Sponsored-by: iXsystems, Inc.
Sponsored-by: vStack
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Authored-by: Matthew Ahrens <mahrens@delphix.com>
Contributions-by: Fedor Uporov <fuporov.vstack@gmail.com>
Contributions-by: Stuart Maybee <stuart.maybee@comcast.net>
Contributions-by: Thorsten Behrens <tbehrens@outlook.com>
Contributions-by: Fmstrat <nospam@nowsci.com>
Contributions-by: Don Brady <dev.fs.zfs@gmail.com>
Signed-off-by: Don Brady <dev.fs.zfs@gmail.com>
Closes #15022
2023-11-08 10:19:41 -08:00
..
zfs-images@3331601f6d Add zimport.sh compatibility test script 2014-02-21 12:10:31 -08:00
.gitignore Remove autotools products 2012-08-27 11:47:44 -07:00
commitcheck.sh Add ShellCheck's --enable=all inside scripts/ 2022-01-13 11:09:19 -07:00
common.sh.in Ubuntu 22.04 integration: ShellCheck 2022-11-18 11:24:48 -08:00
cstyle.pl cstyle: Allow URLs in C++ comments 2022-10-13 11:05:05 -07:00
dkms.mkconf linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
dkms.postbuild Turn shellcheck into a normal make target. Fix new files it caught 2021-06-01 11:38:49 -07:00
enum-extract.pl scripts/enum-extract.pl should not hard code perl path 2022-10-11 12:32:07 -07:00
kmodtool Fix kmodtool for packaging mainline Linux 2023-03-22 09:22:52 -07:00
make_gitrev.sh Add ShellCheck's --enable=all inside scripts/ 2022-01-13 11:09:19 -07:00
Makefile.am CI: Move perl script to dist_noinst_DATA 2023-10-10 13:31:15 -07:00
man-dates.sh Fix minor shellcheck 0.7.2 warnings 2021-06-09 12:21:24 -07:00
mancheck.sh mancheck: exclude dotfiles in man dir 2023-03-01 09:38:31 -08:00
paxcheck.sh Add ShellCheck's --enable=all inside scripts/ 2022-01-13 11:09:19 -07:00
update_authors.pl update_authors: add missing names from commits to AUTHORS 2023-10-10 08:54:57 -07:00
zfs2zol-patch.sed linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
zfs_prepare_disk Add zfs_prepare_disk script for disk firmware install 2023-09-21 08:36:26 -07:00
zfs-helpers.sh cmd: move single-file binaries up, extract udev programs to udev/ 2022-05-10 10:20:34 -07:00
zfs-tests-color.sh Colorize the Github test output 2022-02-16 11:40:25 -08:00
zfs-tests.sh Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs.sh scripts: zfs.sh: explicitly unload all modules via rmmod 2022-04-21 16:33:12 -07:00
zimport.sh Ubuntu 22.04 integration: ShellCheck 2022-11-18 11:24:48 -08:00
zloop.sh RAID-Z expansion feature 2023-11-08 10:19:41 -08:00
zol2zfs-patch.sed Move properties, parameters, events, and concepts around manual sections 2021-06-09 14:35:30 -07:00