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 method 'ReplaceDevice' to btrfs plugin #803

Open
cmurf opened this issue Sep 29, 2020 · 4 comments
Open

RFE: add method 'ReplaceDevice' to btrfs plugin #803

cmurf opened this issue Sep 29, 2020 · 4 comments

Comments

@cmurf
Copy link

cmurf commented Sep 29, 2020

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>
@tbzatek
Copy link
Member

tbzatek commented Sep 29, 2020

(marking as help wanted to encourage the community to come up with patches)

@tbzatek tbzatek changed the title rfe: add method 'ReplaceDevice' to btrfs plugin RFE: add method 'ReplaceDevice' to btrfs plugin Sep 29, 2020
@vojtechtrefny
Copy link
Member

Keep in mind that this needs to be added to libblockdev btrfs plugin first.

@cmurf
Copy link
Author

cmurf commented Sep 29, 2020

Is it possible to reassign this to libblockdev? Or does it need a new issue opened?

@vojtechtrefny
Copy link
Member

Is it possible to reassign this to libblockdev? Or does it need a new issue opened?

GitHub really needs a "duplicate issue" button: storaged-project/libblockdev#573

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

3 participants