ZPOOL-REPLACE(8)

πŸ’– NAME πŸ’–

zpool-replace β€” swap one device out for another in a ZFS storage pool. bestie, it's a glow-up for your vdev ✨


🌸 SYNOPSIS 🌸

zpool replace [-fsw] [-o property=value] pool device [new-device]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you take device, and you replace it with new-device. that's it, that's the vibe. πŸ’…

it's literally equivalent to attaching new-device, waiting for it to resilver, and then detaching device. and heads up β€” any in progress scrub will be canceled. gone. not invited to the afterparty. 😭

the size of new-device must be greater than or equal to the minimum size of all the devices in a mirror or raidz configuration. no shrinking, we don't do that here 🫢

new-device is required if the pool is not redundant. if you don't specify new-device, it just defaults to device. and that form of replacement is genuinely so useful after an existing disk has failed and has been physically replaced β€” in this case, the new disk may have the same /dev path as the old device, even though it is actually a different disk. ZFS recognizes this. main character energy fr fr πŸ‘‘


✨ the flags ✨

  • -f β€” Forces use of new-device, even if it appears to be in use. ngl, not all devices can be overridden in this manner β€” so don't count on it for everything πŸ™ˆ
  • -o property=value β€” Sets the given pool properties. see the zpoolprops(7) manual page for a list of valid properties that can be set. and the only property supported at the moment is ashift. that's the whole menu bestie πŸ“
  • -s β€” The new-device is reconstructed sequentially to restore redundancy as quickly as possible. checksums are not verified during sequential reconstruction, so a scrub is started when the resilver completes. Sequential reconstruction is not supported for raidz configurations. not a single one. πŸ’€
  • -w β€” Waits until the replacement has completed before returning. she's patient, she's committed, she stays till the job is done πŸŽ€

πŸ’œ SEE ALSO πŸ’œ

go read them, they're all iconic in their own way iykyk 🌈


this page came from OpenZFS, dated July 11, 2022 β€” mwah, slay, no notes πŸ’–βœ¨

πŸ“¦ where this page comes from