On Sat, Apr 18, 2015 at 10:36 AM, Kai Krakow <hurikha...@gmail.com> wrote:

> I wonder if one could split mirrors in btrfs... Read:
>
> btrfs device add the new device, set the raid policy for data, meta data,
> and system to raid-1, balance, and then unmount and detach one of the
> devices.
>
> I'm not sure how to get out of the degraded state then. Is it possible to
> simply resort from raid-1 to single raid policy again and remove the missing
> device from the pool?

Not currently. It requires a balance -dconvert=single
-mconvert=single/DUP --force, and it's not efficient, it rewrites the
whole volume. It cannot be paused, canceled or otherwise interrupted
without losing the ability to ever write to the volume again.


> I guess there's one caveat: The signature of both devices will then indicate
> they are belonging to the same pool, making it impossible to ever attach
> those to the same system again without causing trouble for your data. If one
> could change that to make both devices distinct filesystems, it could be
> used to implement a "btrfs filesystem clone" call.

Like ext4 and XFS metadata checksums, the fs UUID is found throughout
the fs metadata. So "breaking" a raid1 back to single ought to include
(and depend on) a feature to change UUIDs in metadata. That code
already exists somewhere because btrfs seed device create, add new
device, delete see device causes the source UUID to be replaced with
the destination UUID in the course of migrating the data. So it can be
done, there just isn't a general purpose method of rewriting only
metadata.

-- 
Chris Murphy
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to