mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ismael Luceno <ismael@iodev.co.uk>
To: linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org
Cc: Ismael Luceno <ismael@iodev.co.uk>,
	David Sterba <dsterba@suse.com>, Chris Mason <mason@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: [PATCH 0/8] btrfs: assemble a multi-device root filesystem without an initrd
Date: Mon, 16 Nov 2026 23:43:16 +0100	[thread overview]
Message-ID: <20261116224316.11237-10-ismael@iodev.co.uk> (raw)

A multi-device btrfs root filesystem is normally assembled by the device
scanner that an initrd runs before mounting the root.  Without an initrd
nothing runs that scanner, so the root mount names a single device and
the rest of the array is left out.

This series lets btrfs assemble such a root filesystem in the kernel:

  * mount devtmpfs on the initial root before the root filesystem, so
    device nodes exist to open the other devices by name (init);
  * let a filesystem tell whether it is mounting the root device and read
    rootwait, and resolve root=UUID=/root=LABEL= values that name the
    filesystem rather than a partition (init/VFS);
  * scan all block devices for the remaining members of a btrfs root
    filesystem, and wait for all of them to appear before mounting.

The scan and wait are gated on CONFIG_BTRFS_ROOT_SCAN (default y) and
only act on the root mount when the user asked for it with rootwait, so
non-root mounts and systems without the option are unchanged.


Ismael Luceno (8):
  btrfs: add config options for the root device scan
  init: mount devtmpfs before the root filesystem
  init: let filesystems ask whether they are mounting the root device
  btrfs: add a helper to scan all block devices
  btrfs: wait for the root filesystem to have all its devices
  Documentation: btrfs: document waiting for the root filesystem devices
  init: let a filesystem resolve a root device by UUID or label
  btrfs: resolve root=UUID= and root=LABEL=

 Documentation/filesystems/btrfs.rst |  31 +++++
 fs/btrfs/Kconfig                    |  25 ++++
 fs/btrfs/super.c                    | 165 +++++++++++++++++++++++
 fs/btrfs/volumes.c                  | 196 ++++++++++++++++++++++++++++
 fs/btrfs/volumes.h                  |  25 ++++
 fs/filesystems.c                    |  37 ++++++
 include/linux/fs.h                  |  10 ++
 include/linux/root_dev.h            |  14 ++
 init/do_mounts.c                    |  51 +++++++-
 9 files changed, 553 insertions(+), 1 deletion(-)


             reply	other threads:[~2026-11-16 22:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 22:43 Ismael Luceno [this message]
2026-11-16 22:43 ` [PATCH 1/8] btrfs: add config options for the root device scan Ismael Luceno
2026-11-16 22:43 ` [PATCH 2/8] init: mount devtmpfs before the root filesystem Ismael Luceno
2026-11-16 22:43 ` [PATCH 3/8] init: let filesystems ask whether they are mounting the root device Ismael Luceno
2026-11-16 22:43 ` [PATCH 4/8] btrfs: add a helper to scan all block devices Ismael Luceno
2026-11-16 22:43 ` [PATCH 5/8] btrfs: wait for the root filesystem to have all its devices Ismael Luceno
2026-11-16 22:43 ` [PATCH 6/8] Documentation: btrfs: document waiting for the root filesystem devices Ismael Luceno
2026-11-16 22:43 ` [PATCH 7/8] init: let a filesystem resolve a root device by UUID or label Ismael Luceno
2026-11-16 22:43 ` [PATCH 8/8] btrfs: resolve root=UUID= and root=LABEL= Ismael Luceno
2026-11-16 23:41 ` [PATCH 0/8] btrfs: assemble a multi-device root filesystem without an initrd Qu Wenruo

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=20261116224316.11237-10-ismael@iodev.co.uk \
    --to=ismael@iodev.co.uk \
    --cc=brauner@kernel.org \
    --cc=dsterba@suse.com \
    --cc=jack@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®