diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-02-20 17:25:14 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-02-21 18:19:38 +0100 |
commit | c56be2c294f55545ea34417a2ec4f6ad2cd1df6f (patch) | |
tree | 93cee6bbda623c51da5ff8d4c9ea16cf776c6a90 /man/bootctl.xml | |
parent | b469b969f30dbb4d4aeeccab79ec8f3782e769aa (diff) | |
download | systemd-c56be2c294f55545ea34417a2ec4f6ad2cd1df6f.tar.gz |
bootctl: add new --print-root-device option
We already have this nice code in system that determines the block
device backing the root file system, but it's only used internally in
systemd-gpt-generator. Let's make this more accessible and expose it
directly in bootctl.
It doesn't fit immediately into the topic of bootctl, but I think it's
close enough and behaves very similar to the existing "bootctl
--print-boot-path" and "--print-esp-path" tools.
If --print-root-device (or -R) is specified once, will show the block device
backing the root fs, and if specified twice (probably easier: -RR) it
will show the whole block device that block device belongs to in case it
is a partition block device.
Suggested use:
# cfdisk `bootctl -RR`
To get access to the partition table, behind the OS install, for
whatever it might be.
Diffstat (limited to 'man/bootctl.xml')
-rw-r--r-- | man/bootctl.xml | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/man/bootctl.xml b/man/bootctl.xml index 42c4b9a8e6..4fec552ca8 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -342,6 +342,22 @@ </varlistentry> <varlistentry> + <term><option>-R</option></term> + <term><option>--print-root-device</option></term> + + <listitem><para>Print the path to the block device node backing the root file system of the local + OS. This prints a path such as <filename>/dev/nvme0n1p5</filename>. If the root file system is backed + by dm-crypt/LUKS or dm-verity the underlying block device is returned. If the root file system is + backed by multiple block devices (as supported by btrfs) the operation will fail. If the switch is + specified twice (i.e. <option>-RR</option>) and the discovered block device is a partition device the + "whole" block device it belongs to is determined and printed + (e.g. <filename>/dev/nvme0n1</filename>). If the root file system is <literal>tmpfs</literal> (or a + similar in-memory file system), the block device backing <filename>/usr/</filename> is returned if + applicable. If the root file system is a network file system (e.g. NFS, CIFS) the operation will + fail.</para></listitem> + </varlistentry> + + <varlistentry> <term><option>--no-variables</option></term> <listitem><para>Do not touch the firmware's boot loader list stored in EFI variables.</para></listitem> </varlistentry> @@ -462,7 +478,9 @@ <refsect1> <title>Exit status</title> - <para>On success, 0 is returned, a non-zero failure code otherwise.</para> + <para>On success, 0 is returned, a non-zero failure code otherwise. <command>bootctl + --print-root-device</command> returns exit status 80 in case the root file system is not backed by single + block device, and other non-zero exit statusses on other errors.</para> </refsect1> <refsect1> |