From: Nikolai Dokutovich <ndokutovich@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Randy Dunlap <rdunlap@infradead.org>,
Shuah Khan <skhan@linuxfoundation.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Nikolai Dokutovich <ndokutovich@gmail.com>
Subject: [PATCH] docs: initrd: remove the linuxrc and root change mechanism
Date: Sun, 29 Nov 2026 04:41:09 +0300 [thread overview]
Message-ID: <20261129014109.57308-1-ndokutovich@gmail.com> (raw)
initrd.rst still tells users to ship /linuxrc and to write the root
device number to /proc/sys/kernel/real-root-dev. Both are gone: the
linuxrc code path was removed together with handle_initrd() and
change_root(), and the sysctl as well, but this document was not
updated.
Drop the change_root step from the boot description, replace the two
sections that document the mechanism, and drop the "older mechanism"
wording from the boot parameter description.
Fixes: c350a65b566b ("initrd: remove deprecated code path (linuxrc)")
Fixes: e6ce36ccc86f ("init: remove /proc/sys/kernel/real-root-dev")
Signed-off-by: Nikolai Dokutovich <ndokutovich@gmail.com>
---
Documentation/admin-guide/initrd.rst | 63 +++++-----------------------
1 file changed, 11 insertions(+), 52 deletions(-)
diff --git a/Documentation/admin-guide/initrd.rst b/Documentation/admin-guide/initrd.rst
index 6c1660a4c5cc..e4b52a64ff5d 100644
--- a/Documentation/admin-guide/initrd.rst
+++ b/Documentation/admin-guide/initrd.rst
@@ -27,9 +27,8 @@ When using initrd, the system typically boots as follows:
1) the boot loader loads the kernel and the initial RAM disk
2) the kernel converts initrd into a "normal" RAM disk and
frees the memory used by initrd
- 3) if the root device is not ``/dev/ram0``, the old (deprecated)
- change_root procedure is followed. see the "Obsolete root change
- mechanism" section below.
+ 3) if the root device is not ``/dev/ram0``, the initrd image is not
+ used as the root file system.
4) root device is mounted. if it is ``/dev/ram0``, the initrd image is
then mounted as root
5) /sbin/init is executed (this can be any valid executable, including
@@ -176,8 +175,7 @@ can try the experimental newlib environment [#f2]_ to create a small
initrd.
Finally, you have to boot the kernel and load initrd. Almost all Linux
-boot loaders support initrd. Since the boot process is still compatible
-with an older mechanism, the following boot command line parameters
+boot loaders support initrd. The following boot command line parameters
have to be given::
root=/dev/ram0 rw
@@ -322,54 +320,15 @@ from the CD-ROM, and loading the RAM disk from CD without need of
floppies.
-Obsolete root change mechanism
-------------------------------
+Removed root change mechanism
+-----------------------------
-The following mechanism was used before the introduction of pivot_root.
-Current kernels still support it, but you should _not_ rely on its
-continued availability.
-
-It works by mounting the "real" root device (i.e. the one set with rdev
-in the kernel image or with root=... at the boot command line) as the
-root file system when linuxrc exits. The initrd file system is then
-unmounted, or, if it is still busy, moved to a directory ``/initrd``, if
-such a directory exists on the new root file system.
-
-In order to use this mechanism, you do not have to specify the boot
-command options root, init, or rw. (If specified, they will affect
-the real root file system, not the initrd environment.)
-
-If /proc is mounted, the "real" root device can be changed from within
-linuxrc by writing the number of the new root FS device to the special
-file /proc/sys/kernel/real-root-dev, e.g.::
-
- # echo 0x301 >/proc/sys/kernel/real-root-dev
-
-Note that the mechanism is incompatible with NFS and similar file
-systems.
-
-This old, deprecated mechanism is commonly called ``change_root``, while
-the new, supported mechanism is called ``pivot_root``.
-
-
-Mixed change_root and pivot_root mechanism
-------------------------------------------
-
-In case you did not want to use ``root=/dev/ram0`` to trigger the pivot_root
-mechanism, you may create both ``/linuxrc`` and ``/sbin/init`` in your initrd
-image.
-
-``/linuxrc`` would contain only the following::
-
- #! /bin/sh
- mount -n -t proc proc /proc
- echo 0x0100 >/proc/sys/kernel/real-root-dev
- umount -n /proc
-
-Once linuxrc exited, the kernel would mount again your initrd as root,
-this time executing ``/sbin/init``. Again, it would be the duty of this init
-to build the right environment (maybe using the ``root= device`` passed on
-the cmdline) before the final execution of the real ``/sbin/init``.
+The ``linuxrc`` mechanism and the ``/proc/sys/kernel/real-root-dev``
+sysctl it used to change the "real" root device were removed. The
+kernel no longer invokes ``/linuxrc`` as a special initrd stage and
+no longer performs the old handoff from the initrd to the final root
+file system; an initrd is mounted as the root file system only when
+the kernel is told to mount it as such.
Resources
--
2.43.0
reply other threads:[~2026-11-29 1:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261129014109.57308-1-ndokutovich@gmail.com \
--to=ndokutovich@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.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
all inboxes | Powered by JetHome®