public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicholas D Steeves <sten@debian.org>
To: kreijack@inwind.it, Mark Harmstone <maharmstone@fb.com>,
	linux-btrfs@vger.kernel.org
Cc: Mark Harmstone <maharmstone@meta.com>,
	Qu Wenruo <quwenruo.btrfs@gmx.com>
Subject: RFC: mkfs.btrfs --subvols UI [was Re: [PATCH] btrfs-progs: add --subvol option to mkfs.btrfs]
Date: Fri, 02 Aug 2024 19:43:27 -0400	[thread overview]
Message-ID: <87plqqqyn4.fsf@digitalmercury.freeddns.org> (raw)
In-Reply-To: <eb3642fd-963b-4a14-9cd2-8339adcb58b7@libero.it>

[-- Attachment #1: Type: text/plain, Size: 1963 bytes --]

Hello,

Qu Wenruo <quwenruo.btrfs@gmx.com> writes:

> 在 2024/6/27 19:24, Mark Harmstone 写道:
>> From: Mark Harmstone <maharmstone@meta.com>
>>
>> This patch adds a --subvol option, which tells mkfs.btrfs to create the
>> specified directories as subvolumes.
>
> I have considered this feature in the past, but I do not have a good
> enough UI for that.

Recursive subvol backup & restore seems to be a desired feature, so I've
considered that in the following:

Goffredo Baroncelli <kreijack@libero.it> writes:

> On 27/06/2024 11.54, Mark Harmstone wrote:
>
> Could be possible to decouple the "--rootdir" and the "--subvol" options ?
> I.e. doing a first iteration where only the subvolume/subdir are created and a second one where
> all the subvolume are populated.
>

This also makes the most sense to me.  In terms of UI, what are the
downsides to the following:

mkfs.btrfs --subvols 1 2 3 4 5 $device
# Creates a flat layout

mkfs.btrfs --subvols subdir/1 subdir/2 subdir/3 subdir/subsubdir/4 \
  subdir/subsubdir/5 $device
# Creates subvols inside plain directories

unless this is specified:

mkdir.btrfs --subvols sv_cont0 sv_cont1 \
 --subvols sv_cont0/1 sv_cont0/2 sv_cont1/3 sv_cont1/4 \
   sv_cont2/5

This creates nested subvolumes, and "sv_cont2/5" will create subvol=5 in
a plain-dir named "sv_cont2" (the gotcha!/pitfall).  Each subsequent
"--subvols foo bar baz" argument creates deeper level of nested
subvolumes.  If the necessary parents haven't yet been created as
subvolumes, they are always created as directories.

And then "--rootdir" unpacks (yes, I'm conceptualising of rootdir as a
tarball).  That said, I wonder if rootdir.img is a special
high-performance format, and wonder if it could benefit from a TOC to
collate subvolumes.  This also seems orthogonal to a future btrfs send
image type would recurse and store subvol layout in a TOC of some kind.

Regards,
Nicholas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]

      parent reply	other threads:[~2024-08-02 23:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27  9:54 [PATCH] btrfs-progs: add --subvol option to mkfs.btrfs Mark Harmstone
2024-06-28  4:12 ` Qu Wenruo
2024-06-28  9:47   ` Mark Harmstone
2024-07-02  3:18     ` Qu Wenruo
2024-06-28 17:06 ` Goffredo Baroncelli
2024-07-01 11:34   ` Mark Harmstone
2024-08-02 23:43   ` Nicholas D Steeves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87plqqqyn4.fsf@digitalmercury.freeddns.org \
    --to=sten@debian.org \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=maharmstone@fb.com \
    --cc=maharmstone@meta.com \
    --cc=quwenruo.btrfs@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox