Re: [PATCH v5] btrfs-progs: add --subvol option to mkfs.btrfs

Mark Harmstone
2024-08-12T14:39:59Z

As Qu said, this patch is just for in-tree subvols. Having out-of-tree
subvols is something I do intend to look at, but it's sufficiently
complicated that it would need a separate patch. You have to worry about
name collisions, missing intermediary directories, etc.

> On 09/08/2024 21.31, David Sterba wrote:
> Can this be fixed so the intermediate directories are created if they
> don't exist? So for example
>
> mkfs.btrfs --rootdir dir --subvolume /var/lib/images
>
> where dir contains only /var. I don't think it's that common but we
> should not make users type something can be done programmaticaly.

--subvol is relative to the working directory, not the root dir, so if
you tried this you'd get an error that /var/lib/images wasn't a child of
dir.

Mark