Skip to content

Commit fa37e1c

Browse files
authored
Merge pull request #972 from cgwalters/doc-fstab
docs/bootc-install: Give more guidance on `root=` and `rootflags=`
2 parents fa94050 + cc8a2cd commit fa37e1c

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

docs/src/bootc-install.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,12 @@ can be configured off at build time via Cargo features.
148148
### Using `bootc install to-filesystem`
149149

150150
The usual expected way for an external storage system to work
151-
is to provide `root=<UUID>` type kernel arguments. Note that
152-
if a separate `/boot` is needed (e.g. for LUKS) you will also need to
153-
provide `--boot-mount-spec UUID=...`.
151+
is to provide `root=<UUID>` and `rootflags` kernel arguments
152+
to describe to the inital RAM disk how to find and mount the
153+
root partition. For more on this, see the below section
154+
discussing mounting the root filesystem.
155+
156+
Note that if a separate `/boot` is needed (e.g. for LUKS) you will also need to provide `--boot-mount-spec UUID=...`.
154157

155158
The `bootc install to-filesystem` command allows an operating
156159
system or distribution to ship a separate installer that creates more complex block
@@ -222,6 +225,39 @@ a different sandboxing tool (e.g. [bubblewrap](https://github.com/containers/bub
222225
This argument is mainly useful for 3rd-party tooling for building disk images from bootable
223226
containers (e.g. based on [osbuild](https://github.com/osbuild/osbuild)).
224227

228+
229+
## Finding and configuring the physical root filesystem
230+
231+
On a bootc system, the "physical root" is different from
232+
the "logical root" of the booted container. For more on
233+
that, see [filesystem](filesystem.md). This section
234+
is about how the physical root filesystem is discovered.
235+
236+
Systems using systemd will often default to using
237+
[systemd-fstab-generator](https://www.freedesktop.org/software/systemd/man/latest/systemd-fstab-generator.html)
238+
and/or [systemd-gpt-auto-generator](https://www.freedesktop.org/software/systemd/man/latest/systemd-gpt-auto-generator.html#).
239+
Support for the latter though for the root filesystem is conditional on EFI and a bootloader implementing the bootloader interface.
240+
241+
Outside of the discoverable partition model, a common baseline default for installers is to set `root=UUID=`
242+
(and optionally `rootflags=`) kernel arguments as machine specific state.
243+
When using `install to-filesystem`, you should provide these as explicit
244+
kernel arguments.
245+
246+
Some installation tools may want to generate an `/etc/fstab`. An important
247+
consideration is that when composefs is on by default (as it is expected
248+
to be) it will no longer work to have an entry for `/` in `/etc/fstab`
249+
(or a systemd `.mount` unit) that handles remounting the rootfs with
250+
updated options after exiting the initrd.
251+
252+
In general, prefer using the `rootflags` kernel argument for that
253+
use case; it ensures that the filesystem is mounted with the
254+
correct options to start, and avoid having an entry for `/`
255+
in `/etc/fstab`.
256+
257+
The physical root is mounted at `/sysroot`. It is an option
258+
for legacy `/etc/fstab` references for `/` to use
259+
`/sysroot` by default, but `rootflags` is prefered.
260+
225261
## Configuring machine-local state
226262

227263
Per the [filesystem](filesystem.md) section, `/etc` and `/var` are machine-local

0 commit comments

Comments
 (0)