All of lore.kernel.org
 help / color / mirror / Atom feed
* Combining two filesystems into single pool
@ 2022-07-26 20:32 Rich Rauenzahn
  2022-07-26 21:02 ` David Sterba
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rich Rauenzahn @ 2022-07-26 20:32 UTC (permalink / raw)
  To: Btrfs BTRFS

I've spent a little while trying to google for this and haven't seem
to hit the right keywords yet or it just isn't possible.

I have two btrfs filesystems.  These are independent filesystems with
mutually exclusive sets of disks.  RAID1, if that matters.

They are mounted on / -- let's say /A and /B.

I'd like to combine the disks into a single filesystem.  These file
systems are large, so creating a third filesystem and merging them is
not practical, nor is copying /B onto /A.

Could I, say, move /A to a subvolume A in itself and then permanently
"connect" /B as a subvolume B, putting all the disks into a single
pool?  And then mount the two subvolumes as /A and /B?

I'd swear I'd seen instructions on how to combine filesystem pools
before, but I can't find it again.

Thoughts or other ideas?

Rich

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combining two filesystems into single pool
  2022-07-26 20:32 Combining two filesystems into single pool Rich Rauenzahn
@ 2022-07-26 21:02 ` David Sterba
  2022-07-26 21:40 ` Roman Mamedov
  2022-07-28  7:19 ` Robert Krig
  2 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2022-07-26 21:02 UTC (permalink / raw)
  To: Rich Rauenzahn; +Cc: Btrfs BTRFS

On Tue, Jul 26, 2022 at 01:32:22PM -0700, Rich Rauenzahn wrote:
> I've spent a little while trying to google for this and haven't seem
> to hit the right keywords yet or it just isn't possible.
> 
> I have two btrfs filesystems.  These are independent filesystems with
> mutually exclusive sets of disks.  RAID1, if that matters.
> 
> They are mounted on / -- let's say /A and /B.
> 
> I'd like to combine the disks into a single filesystem.  These file
> systems are large, so creating a third filesystem and merging them is
> not practical, nor is copying /B onto /A.
> 
> Could I, say, move /A to a subvolume A in itself and then permanently
> "connect" /B as a subvolume B, putting all the disks into a single
> pool?  And then mount the two subvolumes as /A and /B?
> 
> I'd swear I'd seen instructions on how to combine filesystem pools
> before, but I can't find it again.

I'm curious how it would be possible, using btrfs means and not eg.
overlayfs or other meta filesystem providing single view into more
filesystems.

Each fielsystem is using a different number (subvolume id, inode) space,
there's no way to join two into one directly. Some transofrmation or
translation is needed and there's no such feature provided by btrfs.
Theoretically it would be possible to implement, renumbering subvolumes
so they don't collide, add chunk mappings from one filesystem to
devices of the other and merge the directory structures.

Otherwise I see only the options you don't want, copying or 3rd
filesystem. You could do some tricks with deleting device from A and
adding it to B, move some data and repeat.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combining two filesystems into single pool
  2022-07-26 20:32 Combining two filesystems into single pool Rich Rauenzahn
  2022-07-26 21:02 ` David Sterba
@ 2022-07-26 21:40 ` Roman Mamedov
  2022-07-28  7:19 ` Robert Krig
  2 siblings, 0 replies; 4+ messages in thread
From: Roman Mamedov @ 2022-07-26 21:40 UTC (permalink / raw)
  To: Rich Rauenzahn; +Cc: Btrfs BTRFS

On Tue, 26 Jul 2022 13:32:22 -0700
Rich Rauenzahn <rrauenza@gmail.com> wrote:

> Could I, say, move /A to a subvolume A in itself and then permanently
> "connect" /B as a subvolume B, putting all the disks into a single
> pool?  And then mount the two subvolumes as /A and /B?
> 
> I'd swear I'd seen instructions on how to combine filesystem pools
> before, but I can't find it again.

Check out MergerFS.

Although that adds a FUSE layer on top of both filesystems, which might be
fine for a home media library, but maybe not for some other uses.

-- 
With respect,
Roman

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Combining two filesystems into single pool
  2022-07-26 20:32 Combining two filesystems into single pool Rich Rauenzahn
  2022-07-26 21:02 ` David Sterba
  2022-07-26 21:40 ` Roman Mamedov
@ 2022-07-28  7:19 ` Robert Krig
  2 siblings, 0 replies; 4+ messages in thread
From: Robert Krig @ 2022-07-28  7:19 UTC (permalink / raw)
  To: Btrfs BTRFS


Am 26.07.22 um 22:32 schrieb Rich Rauenzahn:
> I've spent a little while trying to google for this and haven't seem
> to hit the right keywords yet or it just isn't possible.
>
> I have two btrfs filesystems.  These are independent filesystems with
> mutually exclusive sets of disks.  RAID1, if that matters.
>
> They are mounted on / -- let's say /A and /B.
>
> I'd like to combine the disks into a single filesystem.  These file
> systems are large, so creating a third filesystem and merging them is
> not practical, nor is copying /B onto /A.
>
> Could I, say, move /A to a subvolume A in itself and then permanently
> "connect" /B as a subvolume B, putting all the disks into a single
> pool?  And then mount the two subvolumes as /A and /B?
>
> I'd swear I'd seen instructions on how to combine filesystem pools
> before, but I can't find it again.
>
> Thoughts or other ideas?
>
> Rich


If both filesystems are independent Raid1, then you could theoretically 
remove one disk from Array B and add it to Array A. Perhaps temporarily 
rebalance A to be single so you maximize your space, then start copying 
stuff.

Depends on how big your disks are, how many you have in each array.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-28  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-26 20:32 Combining two filesystems into single pool Rich Rauenzahn
2022-07-26 21:02 ` David Sterba
2022-07-26 21:40 ` Roman Mamedov
2022-07-28  7:19 ` Robert Krig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.