From: Linus Heckemann <linus@schreibt.jetzt>
To: linux-bcachefs@vger.kernel.org
Subject: Mounting subvolumes or subtrees
Date: Sun, 20 Aug 2023 19:11:06 +0000 [thread overview]
Message-ID: <yga1qfx34xh.fsf@localhost> (raw)
Hi all!
I'd like to use bcachefs as my root filesystem -- but I don't want / to
be the root of the filesystem.
This is achievable with btrfs using subvolume mounts (passing -o
subvol=... or -o subvolid=... to the mount program), but having looked
at the way it's handled on the kernel side (duplication of code from
fs/super.c in fs/btrfs/super.c) I'm pretty sure that's not something
that should be repeated in bcachefs.
It can also be done by having an initramfs that mounts the root of the
filesystem, then bind-mounts a subpath of that and
switch_root/pivot_root-ing into the bind mount. However, this approach isn't
representable in a classic fstab -- the root of the filesystem needs to
be mounted somewhere, but given that I want the subtree to be /, we have
nowhere to mount it.
One idea I have -- and I haven't read enough code yet to tell whether
the APIs already support this -- is that the new mount API
(fsopen/move_mount flow) could be used as-is or extended to support
mounting a subtree of a filesystem without needing an intermediate mount
of its root. This would allow _all_ filesystems to benefit from this
ability, not just bcachefs -- and to represent this as a "fake mount
option", much like X-mount.mkdir, in util-linux, making it possible to
put this type of mount in an fstab.
I'd appreciate any opinions on whether my thoughts make sense, and how
else my goal might be achievable.
Cheers
Linus
next reply other threads:[~2023-08-20 19:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-20 19:11 Linus Heckemann [this message]
2023-08-22 19:33 ` Mounting subvolumes or subtrees Kent Overstreet
2023-09-18 13:08 ` Linus Heckemann
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=yga1qfx34xh.fsf@localhost \
--to=linus@schreibt.jetzt \
--cc=linux-bcachefs@vger.kernel.org \
/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