Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: add function 'bd_btrfs_replace_device' to btrfs plugin #573

Open
vojtechtrefny opened this issue Sep 30, 2020 · 0 comments
Open

RFE: add function 'bd_btrfs_replace_device' to btrfs plugin #573

vojtechtrefny opened this issue Sep 30, 2020 · 0 comments

Comments

@vojtechtrefny
Copy link
Member

http://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.Filesystem.BTRFS.html

Instead of AddDevice followed by RemoveDevice, it's preferred to use btrfs replace. Both btrfs device add/remove imply file system resize, and also a relatively expensive balance. Whereas replace is a variation on scrub, and is a sort of virtual and temporary raid1 between the device being replaced and the new device. Both devices are used for reads and writes, so there's better safety as well as performance.

There are two current caveats: the replacement block device must be equal to or larger than the device being replaced; and once replacement is complete, there is no automatic resize (grow) to take advantage of space for a larger device.

It's actually more expedient to do a minimal resize (shrink) of a device being replaced, in order to make it possible to use replace instead of add followed by remove.

man btrfs replace
       start [-Bfr] <srcdev>|<devid> <targetdev> <path>

_Originally posted by @cmurf in storaged-project/udisks#803

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant