Bug #7614


zfs device evacuation/removal

Added by Matthew Ahrens about 7 years ago. Updated over 5 years ago.

zfs - Zettabyte File System
Start date:
Due date:
% Done:


Estimated time:
(Total: 0.00 h)
Gerrit CR:
External Bug:


This project allows top-level vdevs to be removed from the storage pool with “zpool remove”, reducing the total amount of storage in the pool. This operation copies all allocated regions of the device to be removed onto other devices, recording the mapping from old to new location. After the removal is complete, read and free operations to the removed (now “indirect”) vdev must be remapped and performed at the new location on disk. The indirect mapping table is kept in memory whenever the pool is loaded, so there is minimal performance overhead when doing operations on the indirect vdev.

The size of the in-memory mapping table will be reduced when its entries become “obsolete” because they are no longer used by any block pointers in the pool. An entry becomes obsolete when all the blocks that use it are freed. An entry can also become obsolete when all the snapshots that reference it are deleted, and the block pointers that reference it have been “remapped” in all filesystems/zvols (and clones). Whenever an indirect block is written, all the block pointers in it will be “remapped” to their new (concrete) locations if possible. This process can be accelerated by using the “zfs remap” command to proactively rewrite all indirect blocks that reference indirect (removed) vdevs.

Note that when a device is removed, we do not verify the checksum of the data that is copied. This makes the process much faster, but if it were used on redundant vdevs (i.e. mirror or raidz vdevs), it would be possible to copy the wrong data, when we have the correct data on e.g. the other side of the mirror. Therefore, mirror and raidz devices can not be removed.

Subtasks 1 (0 open1 closed)

Bug #9434: Speculative prefetch is blocked by device removal codeClosedAlexander Motin2018-04-03


Related issues

Related to illumos gate - Feature #10166: loader: support com.delphix:removingClosedToomas Soome2018-12-26

Has duplicate illumos gate - Feature #6903: delphix vdev/device removal/evacuationClosed2016-04-11

Actions #1

Updated by Yuri Pankov over 6 years ago

  • Has duplicate Feature #6903: delphix vdev/device removal/evacuation added
Actions #2

Updated by Electric Monk almost 6 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 5cabbc6b49070407fb9610cfe73d4c0e0dea3e77

commit  5cabbc6b49070407fb9610cfe73d4c0e0dea3e77
Author: Prashanth Sreenivasa <>
Date:   2018-01-10T16:00:10.000Z

    7614 zfs device evacuation/removal
    Reviewed by: Alex Reece <>
    Reviewed by: George Wilson <>
    Reviewed by: John Kennedy <>
    Reviewed by: Prakash Surya <>
    Reviewed by: Matthew Ahrens <>
    Reviewed by: Richard Laager <>
    Reviewed by: Tim Chase <>
    Approved by: Garrett D'Amore <>

Actions #3

Updated by Toomas Soome about 4 years ago

  • Related to Feature #10166: loader: support com.delphix:removing added

Also available in: Atom PDF