€•ýùŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ&/translations/zh_CN/admin-guide/initrd”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/zh_TW/admin-guide/initrd”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/it_IT/admin-guide/initrd”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/ja_JP/admin-guide/initrd”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/ko_KR/admin-guide/initrd”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/pt_BR/admin-guide/initrd”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/sp_SP/admin-guide/initrd”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ#Using the initial RAM disk (initrd)”h]”hŒ#Using the initial RAM disk (initrd)”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ@/var/lib/git/docbuild/linux/Documentation/admin-guide/initrd.rst”h´KubhŒ paragraph”“”)�”}”(hŒeWritten 1996,2000 by Werner Almesberger and Hans Lermen ”h]”(hŒ)Written 1996,2000 by Werner Almesberger <”…”�”}”(hhÍh²hh³Nh´NubhŒ reference”“”)�”}”(hŒwerner.almesberger@epfl.ch”h]”hŒwerner.almesberger@epfl.ch”…”�”}”(hh×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ!mailto:werner.almesberger@epfl.ch”uh1hÕhhÍubhŒ> and Hans Lermen <”…”�”}”(hhÍh²hh³Nh´NubhÖ)�”}”(hŒlermen@fgan.de”h]”hŒlermen@fgan.de”…”�”}”(hhëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:lermen@fgan.de”uh1hÕhhÍubhŒ>”…”�”}”(hhÍh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)�”}”(hXKinitrd provides the capability to load a RAM disk by the boot loader. This RAM disk can then be mounted as the root file system and programs can be run from it. Afterwards, a new root file system can be mounted from a different device. The previous root (from initrd) is then moved to a directory and can be subsequently unmounted.”h]”hXKinitrd provides the capability to load a RAM disk by the boot loader. This RAM disk can then be mounted as the root file system and programs can be run from it. Afterwards, a new root file system can be mounted from a different device. The previous root (from initrd) is then moved to a directory and can be subsequently unmounted.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)�”}”(hŒÃinitrd is mainly designed to allow system startup to occur in two phases, where the kernel comes up with a minimum set of compiled-in drivers, and where additional modules are loaded from initrd.”h]”hŒÃinitrd is mainly designed to allow system startup to occur in two phases, where the kernel comes up with a minimum set of compiled-in drivers, and where additional modules are loaded from initrd.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)�”}”(hŒ�This document gives a brief overview of the use of initrd. A more detailed discussion of the boot process can be found in [#f1]_.”h]”(hŒzThis document gives a brief overview of the use of initrd. A more detailed discussion of the boot process can be found in ”…”�”}”(hj!h²hh³Nh´NubhŒfootnote_reference”“”)�”}”(hŒ[#f1]_”h]”hŒ1”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”Œid1”ah ]”h"]”h$]”h&]”Œauto”KŒrefid”Œf1”Œdocname”Œadmin-guide/initrd”uh1j)hj!Œresolved”KubhŒ.”…”�”}”(hj!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ Operation”h]”hŒ Operation”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjJh²hh³hÊh´KubhÌ)�”}”(hŒ9When using initrd, the system typically boots as follows:”h]”hŒ9When using initrd, the system typically boots as follows:”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjJh²hubhŒ block_quote”“”)�”}”(hXL1) 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. 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 shell scripts; it is run with uid 0 and can do basically everything init can do). 6) init mounts the "real" root file system 7) init places the root file system at the root directory using the pivot_root system call 8) init execs the ``/sbin/init`` on the new root filesystem, performing the usual boot sequence 9) the initrd file system is removed ”h]”hŒenumerated_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒ9the boot loader loads the kernel and the initial RAM disk”h]”hÌ)�”}”(hjxh]”hŒ9the boot loader loads the kernel and the initial RAM disk”…”�”}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjvubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubju)�”}”(hŒWthe kernel converts initrd into a "normal" RAM disk and frees the memory used by initrd”h]”hÌ)�”}”(hŒWthe kernel converts initrd into a "normal" RAM disk and frees the memory used by initrd”h]”hŒ[the kernel converts initrd into a “normalâ€� RAM disk and frees the memory used by initrd”…”�”}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubju)�”}”(hŒ˜if the root device is not ``/dev/ram0``, the old (deprecated) change_root procedure is followed. see the "Obsolete root change mechanism" section below.”h]”hÌ)�”}”(hŒ˜if the root device is not ``/dev/ram0``, the old (deprecated) change_root procedure is followed. see the "Obsolete root change mechanism" section below.”h]”(hŒif the root device is not ”…”�”}”(hj©h²hh³Nh´NubhŒliteral”“”)�”}”(hŒ ``/dev/ram0``”h]”hŒ /dev/ram0”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj©ubhŒu, the old (deprecated) change_root procedure is followed. see the “Obsolete root change mechanismâ€� section below.”…”�”}”(hj©h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj¥ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubju)�”}”(hŒXroot device is mounted. if it is ``/dev/ram0``, the initrd image is then mounted as root”h]”hÌ)�”}”(hŒXroot device is mounted. if it is ``/dev/ram0``, the initrd image is then mounted as root”h]”(hŒ!root device is mounted. if it is ”…”�”}”(hjÕh²hh³Nh´Nubj²)�”}”(hŒ ``/dev/ram0``”h]”hŒ /dev/ram0”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjÕubhŒ*, the initrd image is then mounted as root”…”�”}”(hjÕh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K!hjÑubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubju)�”}”(hŒ•/sbin/init is executed (this can be any valid executable, including shell scripts; it is run with uid 0 and can do basically everything init can do).”h]”hÌ)�”}”(hŒ•/sbin/init is executed (this can be any valid executable, including shell scripts; it is run with uid 0 and can do basically everything init can do).”h]”hŒ•/sbin/init is executed (this can be any valid executable, including shell scripts; it is run with uid 0 and can do basically everything init can do).”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K#hjûubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubju)�”}”(hŒ'init mounts the "real" root file system”h]”hÌ)�”}”(hjh]”hŒ+init mounts the “realâ€� root file system”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K&hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubju)�”}”(hŒWinit places the root file system at the root directory using the pivot_root system call”h]”hÌ)�”}”(hŒWinit places the root file system at the root directory using the pivot_root system call”h]”hŒWinit places the root file system at the root directory using the pivot_root system call”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K'hj*ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubju)�”}”(hŒ\init execs the ``/sbin/init`` on the new root filesystem, performing the usual boot sequence”h]”hÌ)�”}”(hŒ\init execs the ``/sbin/init`` on the new root filesystem, performing the usual boot sequence”h]”(hŒinit execs the ”…”�”}”(hjFh²hh³Nh´Nubj²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjFubhŒ? on the new root filesystem, performing the usual boot sequence”…”�”}”(hjFh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K)hjBubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubju)�”}”(hŒ"the initrd file system is removed ”h]”hÌ)�”}”(hŒ!the initrd file system is removed”h]”hŒ!the initrd file system is removed”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K+hjlubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjqubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ)”uh1johjkubah}”(h]”h ]”h"]”h$]”h&]”uh1jih³hÊh´KhjJh²hubhÌ)�”}”(hŒæNote that changing the root directory does not involve unmounting it. It is therefore possible to leave processes running on initrd during that procedure. Also note that file systems mounted under initrd continue to be accessible.”h]”hŒæNote that changing the root directory does not involve unmounting it. It is therefore possible to leave processes running on initrd during that procedure. Also note that file systems mounted under initrd continue to be accessible.”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K-hjJh²hubeh}”(h]”Œ operation”ah ]”h"]”Œ operation”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)�”}”(hhh]”(h»)�”}”(hŒBoot command-line options”h]”hŒBoot command-line options”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj«h²hh³hÊh´K4ubhÌ)�”}”(hŒ'initrd adds the following new options::”h]”hŒ&initrd adds the following new options:”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K6hj«h²hubhŒ literal_block”“”)�”}”(hXHinitrd= (e.g. LOADLIN) Loads the specified file as the initial RAM disk. When using LILO, you have to specify the RAM disk image file in /etc/lilo.conf, using the INITRD configuration variable. noinitrd initrd data is preserved but it is not converted to a RAM disk and the "normal" root file system is mounted. initrd data can be read from /dev/initrd. Note that the data in initrd can have any structure in this case and doesn't necessarily have to be a file system image. This option is used mainly for debugging. Note: /dev/initrd is read-only and it can only be used once. As soon as the last process has closed it, all data is freed and /dev/initrd can't be opened anymore. root=/dev/ram0 initrd is mounted as root, and the normal boot procedure is followed, with the RAM disk mounted as root.”h]”hXHinitrd= (e.g. LOADLIN) Loads the specified file as the initial RAM disk. When using LILO, you have to specify the RAM disk image file in /etc/lilo.conf, using the INITRD configuration variable. noinitrd initrd data is preserved but it is not converted to a RAM disk and the "normal" root file system is mounted. initrd data can be read from /dev/initrd. Note that the data in initrd can have any structure in this case and doesn't necessarily have to be a file system image. This option is used mainly for debugging. Note: /dev/initrd is read-only and it can only be used once. As soon as the last process has closed it, all data is freed and /dev/initrd can't be opened anymore. root=/dev/ram0 initrd is mounted as root, and the normal boot procedure is followed, with the RAM disk mounted as root.”…”�”}”hjÌsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jÊh³hÊh´K8hj«h²hubeh}”(h]”Œboot-command-line-options”ah ]”h"]”Œboot command-line options”ah$]”h&]”uh1hµhh·h²hh³hÊh´K4ubh¶)�”}”(hhh]”(h»)�”}”(hŒCompressed cpio images”h]”hŒCompressed cpio images”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjäh²hh³hÊh´KPubhÌ)�”}”(hX8Recent kernels have support for populating a ramdisk from a compressed cpio archive. On such systems, the creation of a ramdisk image doesn't need to involve special block devices or loopbacks; you merely create a directory on disk with the desired initrd content, cd to that directory, and run (as an example)::”h]”hX9Recent kernels have support for populating a ramdisk from a compressed cpio archive. On such systems, the creation of a ramdisk image doesn’t need to involve special block devices or loopbacks; you merely create a directory on disk with the desired initrd content, cd to that directory, and run (as an example):”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KRhjäh²hubjË)�”}”(hŒCfind . | cpio --quiet -H newc -o | gzip -9 -n > /boot/imagefile.img”h]”hŒCfind . | cpio --quiet -H newc -o | gzip -9 -n > /boot/imagefile.img”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´KXhjäh²hubhÌ)�”}”(hŒDExamining the contents of an existing image file is just as simple::”h]”hŒCExamining the contents of an existing image file is just as simple:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KZhjäh²hubjË)�”}”(hŒWmkdir /tmp/imagefile cd /tmp/imagefile gzip -cd /boot/imagefile.img | cpio -imd --quiet”h]”hŒWmkdir /tmp/imagefile cd /tmp/imagefile gzip -cd /boot/imagefile.img | cpio -imd --quiet”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´K\hjäh²hubeh}”(h]”Œcompressed-cpio-images”ah ]”h"]”Œcompressed cpio images”ah$]”h&]”uh1hµhh·h²hh³hÊh´KPubh¶)�”}”(hhh]”(h»)�”}”(hŒ Installation”h]”hŒ Installation”…”�”}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj5h²hh³hÊh´KaubhÌ)�”}”(hŒhFirst, a directory for the initrd file system has to be created on the "normal" root file system, e.g.::”h]”hŒkFirst, a directory for the initrd file system has to be created on the “normalâ€� root file system, e.g.:”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kchj5h²hubjË)�”}”(hŒ# mkdir /initrd”h]”hŒ# mkdir /initrd”…”�”}”hjTsbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´Kfhj5h²hubhÌ)�”}”(hŒ]The name is not relevant. More details can be found on the :manpage:`pivot_root(2)` man page.”h]”(hŒ;The name is not relevant. More details can be found on the ”…”�”}”(hjbh²hh³Nh´NubhŒmanpage”“”)�”}”(hŒ:manpage:`pivot_root(2)`”h]”hŒ pivot_root(2)”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”jjah"]”h$]”h&]”jÚjÛŒpath”Œ pivot_root(2)”Œpage”Œ pivot_root”Œsection”Œ2”uh1jjhjbubhŒ man page.”…”�”}”(hjbh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khhj5h²hubhÌ)�”}”(hŒºIf the root file system is created during the boot procedure (i.e. if you're building an install floppy), the root file system creation procedure should create the ``/initrd`` directory.”h]”(hŒ¦If the root file system is created during the boot procedure (i.e. if you’re building an install floppy), the root file system creation procedure should create the ”…”�”}”(hjŠh²hh³Nh´Nubj²)�”}”(hŒ ``/initrd``”h]”hŒ/initrd”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjŠubhŒ directory.”…”�”}”(hjŠh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kkhj5h²hubhÌ)�”}”(hŒwIf initrd will not be mounted in some cases, its content is still accessible if the following device has been created::”h]”hŒvIf initrd will not be mounted in some cases, its content is still accessible if the following device has been created:”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kohj5h²hubjË)�”}”(hŒ3# mknod /dev/initrd b 1 250 # chmod 400 /dev/initrd”h]”hŒ3# mknod /dev/initrd b 1 250 # chmod 400 /dev/initrd”…”�”}”hj¸sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´Krhj5h²hubhÌ)�”}”(hŒþSecond, the kernel has to be compiled with RAM disk support and with support for the initial RAM disk enabled. Also, at least all components needed to execute programs from initrd (e.g. executable format and file system) must be compiled into the kernel.”h]”hŒþSecond, the kernel has to be compiled with RAM disk support and with support for the initial RAM disk enabled. Also, at least all components needed to execute programs from initrd (e.g. executable format and file system) must be compiled into the kernel.”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kuhj5h²hubhÌ)�”}”(hXThird, you have to create the RAM disk image. This is done by creating a file system on a block device, copying files to it as needed, and then copying the content of the block device to the initrd file. With recent kernels, at least three types of devices are suitable for that:”h]”hXThird, you have to create the RAM disk image. This is done by creating a file system on a block device, copying files to it as needed, and then copying the content of the block device to the initrd file. With recent kernels, at least three types of devices are suitable for that:”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kzhj5h²hubjj)�”}”(hŒž- a floppy disk (works everywhere but it's painfully slow) - a RAM disk (fast, but allocates physical memory) - a loopback device (the most elegant solution) ”h]”hŒ bullet_list”“”)�”}”(hhh]”(ju)�”}”(hŒ8a floppy disk (works everywhere but it's painfully slow)”h]”hÌ)�”}”(hjíh]”hŒ:a floppy disk (works everywhere but it’s painfully slow)”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjëubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjèubju)�”}”(hŒ0a RAM disk (fast, but allocates physical memory)”h]”hÌ)�”}”(hjh]”hŒ0a RAM disk (fast, but allocates physical memory)”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K€hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjèubju)�”}”(hŒ.a loopback device (the most elegant solution) ”h]”hÌ)�”}”(hŒ-a loopback device (the most elegant solution)”h]”hŒ-a loopback device (the most elegant solution)”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K�hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjèubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jæh³hÊh´Khjâubah}”(h]”h ]”h"]”h$]”h&]”uh1jih³hÊh´Khj5h²hubhÌ)�”}”(hŒ*We'll describe the loopback device method:”h]”hŒ,We’ll describe the loopback device method:”…”�”}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kƒhj5h²hubjj)�”}”(hX 1) make sure loopback block devices are configured into the kernel 2) create an empty file system of the appropriate size, e.g.:: # dd if=/dev/zero of=initrd bs=300k count=1 # mke2fs -F -m0 initrd (if space is critical, you may want to use the Minix FS instead of Ext2) 3) mount the file system, e.g.:: # mount -t ext2 -o loop initrd /mnt 4) create the console device:: # mkdir /mnt/dev # mknod /mnt/dev/console c 5 1 5) copy all the files that are needed to properly use the initrd environment. Don't forget the most important file, ``/sbin/init`` .. note:: ``/sbin/init`` permissions must include "x" (execute). 6) correct operation the initrd environment can frequently be tested even without rebooting with the command:: # chroot /mnt /sbin/init This is of course limited to initrds that do not interfere with the general system state (e.g. by reconfiguring network interfaces, overwriting mounted devices, trying to start already running demons, etc. Note however that it is usually possible to use pivot_root in such a chroot'ed initrd environment.) 7) unmount the file system:: # umount /mnt 8) the initrd is now in the file "initrd". Optionally, it can now be compressed:: # gzip -9 initrd ”h]”jp)�”}”(hhh]”(ju)�”}”(hŒ?make sure loopback block devices are configured into the kernel”h]”hÌ)�”}”(hjVh]”hŒ?make sure loopback block devices are configured into the kernel”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K…hjTubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjQubju)�”}”(hŒÑcreate an empty file system of the appropriate size, e.g.:: # dd if=/dev/zero of=initrd bs=300k count=1 # mke2fs -F -m0 initrd (if space is critical, you may want to use the Minix FS instead of Ext2)”h]”(hÌ)�”}”(hŒ;create an empty file system of the appropriate size, e.g.::”h]”hŒ:create an empty file system of the appropriate size, e.g.:”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K†hjkubjË)�”}”(hŒB# dd if=/dev/zero of=initrd bs=300k count=1 # mke2fs -F -m0 initrd”h]”hŒB# dd if=/dev/zero of=initrd bs=300k count=1 # mke2fs -F -m0 initrd”…”�”}”hj}sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´KˆhjkubhÌ)�”}”(hŒH(if space is critical, you may want to use the Minix FS instead of Ext2)”h]”hŒH(if space is critical, you may want to use the Minix FS instead of Ext2)”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K‹hjkubeh}”(h]”h ]”h"]”h$]”h&]”uh1jthjQubju)�”}”(hŒGmount the file system, e.g.:: # mount -t ext2 -o loop initrd /mnt ”h]”(hÌ)�”}”(hŒmount the file system, e.g.::”h]”hŒmount the file system, e.g.:”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŒhjŸubjË)�”}”(hŒ## mount -t ext2 -o loop initrd /mnt”h]”hŒ## mount -t ext2 -o loop initrd /mnt”…”�”}”hj±sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´KŽhjŸubeh}”(h]”h ]”h"]”h$]”h&]”uh1jthjQubju)�”}”(hŒMcreate the console device:: # mkdir /mnt/dev # mknod /mnt/dev/console c 5 1 ”h]”(hÌ)�”}”(hŒcreate the console device::”h]”hŒcreate the console device:”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K�hjÅubjË)�”}”(hŒ/# mkdir /mnt/dev # mknod /mnt/dev/console c 5 1”h]”hŒ/# mkdir /mnt/dev # mknod /mnt/dev/console c 5 1”…”�”}”hj×sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´K’hjÅubeh}”(h]”h ]”h"]”h$]”h&]”uh1jthjQubju)�”}”(hŒÂcopy all the files that are needed to properly use the initrd environment. Don't forget the most important file, ``/sbin/init`` .. note:: ``/sbin/init`` permissions must include "x" (execute). ”h]”(hÌ)�”}”(hŒcopy all the files that are needed to properly use the initrd environment. Don't forget the most important file, ``/sbin/init``”h]”(hŒscopy all the files that are needed to properly use the initrd environment. Don’t forget the most important file, ”…”�”}”(hjïh²hh³Nh´Nubj²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjïubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K•hjëubhŒnote”“”)�”}”(hŒ6``/sbin/init`` permissions must include "x" (execute).”h]”hÌ)�”}”(hjh]”(j²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjubhŒ, permissions must include “xâ€� (execute).”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K˜hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjëubeh}”(h]”h ]”h"]”h$]”h&]”uh1jthjQubju)�”}”(hX¼correct operation the initrd environment can frequently be tested even without rebooting with the command:: # chroot /mnt /sbin/init This is of course limited to initrds that do not interfere with the general system state (e.g. by reconfiguring network interfaces, overwriting mounted devices, trying to start already running demons, etc. Note however that it is usually possible to use pivot_root in such a chroot'ed initrd environment.)”h]”(hÌ)�”}”(hŒkcorrect operation the initrd environment can frequently be tested even without rebooting with the command::”h]”hŒjcorrect operation the initrd environment can frequently be tested even without rebooting with the command:”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kšhj8ubjË)�”}”(hŒ# chroot /mnt /sbin/init”h]”hŒ# chroot /mnt /sbin/init”…”�”}”hjJsbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´K�hj8ubhÌ)�”}”(hX1This is of course limited to initrds that do not interfere with the general system state (e.g. by reconfiguring network interfaces, overwriting mounted devices, trying to start already running demons, etc. Note however that it is usually possible to use pivot_root in such a chroot'ed initrd environment.)”h]”hX3This is of course limited to initrds that do not interfere with the general system state (e.g. by reconfiguring network interfaces, overwriting mounted devices, trying to start already running demons, etc. Note however that it is usually possible to use pivot_root in such a chroot’ed initrd environment.)”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŸhj8ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jthjQubju)�”}”(hŒ-unmount the file system:: # umount /mnt ”h]”(hÌ)�”}”(hŒunmount the file system::”h]”hŒunmount the file system:”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¤hjlubjË)�”}”(hŒ # umount /mnt”h]”hŒ # umount /mnt”…”�”}”hj~sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´K¦hjlubeh}”(h]”h ]”h"]”h$]”h&]”uh1jthjQubju)�”}”(hŒethe initrd is now in the file "initrd". Optionally, it can now be compressed:: # gzip -9 initrd ”h]”(hÌ)�”}”(hŒNthe initrd is now in the file "initrd". Optionally, it can now be compressed::”h]”hŒQthe initrd is now in the file “initrdâ€�. Optionally, it can now be compressed:”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¨hj’ubjË)�”}”(hŒ# gzip -9 initrd”h]”hŒ# gzip -9 initrd”…”�”}”hj¤sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´K«hj’ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jthjQubeh}”(h]”h ]”h"]”h$]”h&]”jŠj‹jŒhj�jŽuh1johjMubah}”(h]”h ]”h"]”h$]”h&]”uh1jih³hÊh´K…hj5h²hubhÌ)�”}”(hŒäFor experimenting with initrd, you may want to take a rescue floppy and only add a symbolic link from ``/sbin/init`` to ``/bin/sh``. Alternatively, you can try the experimental newlib environment [#f2]_ to create a small initrd.”h]”(hŒfFor experimenting with initrd, you may want to take a rescue floppy and only add a symbolic link from ”…”�”}”(hjÄh²hh³Nh´Nubj²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjÄubhŒ to ”…”�”}”(hjÄh²hh³Nh´Nubj²)�”}”(hŒ ``/bin/sh``”h]”hŒ/bin/sh”…”�”}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjÄubhŒA. Alternatively, you can try the experimental newlib environment ”…”�”}”(hjÄh²hh³Nh´Nubj*)�”}”(hŒ[#f2]_”h]”hŒ2”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”Œid2”ah ]”h"]”h$]”h&]”j:Kj;Œf2”j=j>uh1j)hjÄj?KubhŒ to create a small initrd.”…”�”}”(hjÄh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K­hj5h²hubhÌ)�”}”(hŒå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 have to be given::”h]”hŒä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 have to be given:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K²hj5h²hubjË)�”}”(hŒroot=/dev/ram0 rw”h]”hŒroot=/dev/ram0 rw”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´K·hj5h²hubhÌ)�”}”(hŒ<(rw is only necessary if writing to the initrd file system.)”h]”hŒ<(rw is only necessary if writing to the initrd file system.)”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¹hj5h²hubhÌ)�”}”(hŒ"With LOADLIN, you simply execute::”h]”hŒ!With LOADLIN, you simply execute:”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K»hj5h²hubjË)�”}”(hŒ$LOADLIN initrd=”h]”hŒ$LOADLIN initrd=”…”�”}”hjBsbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´K½hj5h²hubhÌ)�”}”(hŒe.g.::”h]”hŒe.g.:”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¿hj5h²hubjË)�”}”(hŒDLOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0 rw”h]”hŒDLOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0 rw”…”�”}”hj^sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´KÁhj5h²hubhÌ)�”}”(hŒ¸With LILO, you add the option ``INITRD=`` to either the global section or to the section of the respective kernel in ``/etc/lilo.conf``, and pass the options using APPEND, e.g.::”h]”(hŒWith LILO, you add the option ”…”�”}”(hjlh²hh³Nh´Nubj²)�”}”(hŒ``INITRD=``”h]”hŒ INITRD=”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjlubhŒL to either the global section or to the section of the respective kernel in ”…”�”}”(hjlh²hh³Nh´Nubj²)�”}”(hŒ``/etc/lilo.conf``”h]”hŒ/etc/lilo.conf”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjlubhŒ*, and pass the options using APPEND, e.g.:”…”�”}”(hjlh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÃhj5h²hubjË)�”}”(hŒJimage = /bzImage initrd = /boot/initrd.gz append = "root=/dev/ram0 rw"”h]”hŒJimage = /bzImage initrd = /boot/initrd.gz append = "root=/dev/ram0 rw"”…”�”}”hjžsbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´KÇhj5h²hubhÌ)�”}”(hŒand run ``/sbin/lilo``”h]”(hŒand run ”…”�”}”(hj¬h²hh³Nh´Nubj²)�”}”(hŒ``/sbin/lilo``”h]”hŒ /sbin/lilo”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj¬ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KËhj5h²hubhÌ)�”}”(hŒEFor other boot loaders, please refer to the respective documentation.”h]”hŒEFor other boot loaders, please refer to the respective documentation.”…”�”}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÍhj5h²hubhÌ)�”}”(hŒ(Now you can boot and enjoy using initrd.”h]”hŒ(Now you can boot and enjoy using initrd.”…”�”}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÏhj5h²hubeh}”(h]”Œ installation”ah ]”h"]”Œ installation”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kaubh¶)�”}”(hhh]”(h»)�”}”(hŒChanging the root device”h]”hŒChanging the root device”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjìh²hh³hÊh´KÓubhÌ)�”}”(hŒŒWhen finished with its duties, init typically changes the root device and proceeds with starting the Linux system on the "real" root device.”h]”hŒ�When finished with its duties, init typically changes the root device and proceeds with starting the Linux system on the “realâ€� root device.”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÕhjìh²hubhŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hŒ÷The procedure involves the following steps: - mounting the new root file system - turning it into the root file system - removing all accesses to the old (initrd) root file system - unmounting the initrd file system and de-allocating the RAM disk ”h]”(hŒterm”“”)�”}”(hŒ+The procedure involves the following steps:”h]”hŒ+The procedure involves the following steps:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÜhjubhŒ definition”“”)�”}”(hhh]”jç)�”}”(hhh]”(ju)�”}”(hŒ!mounting the new root file system”h]”hÌ)�”}”(hj0h]”hŒ!mounting the new root file system”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÙhj.ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj+ubju)�”}”(hŒ$turning it into the root file system”h]”hÌ)�”}”(hjGh]”hŒ$turning it into the root file system”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÚhjEubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj+ubju)�”}”(hŒ:removing all accesses to the old (initrd) root file system”h]”hÌ)�”}”(hj^h]”hŒ:removing all accesses to the old (initrd) root file system”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÛhj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj+ubju)�”}”(hŒAunmounting the initrd file system and de-allocating the RAM disk ”h]”hÌ)�”}”(hŒ@unmounting the initrd file system and de-allocating the RAM disk”h]”hŒ@unmounting the initrd file system and de-allocating the RAM disk”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÜhjsubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj+ubeh}”(h]”h ]”h"]”h$]”h&]”j7j8uh1jæh³hÊh´KÙhj(ubah}”(h]”h ]”h"]”h$]”h&]”uh1j&hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÜhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjìh²hh³Nh´NubhÌ)�”}”(hŒwMounting the new root file system is easy: it just needs to be mounted on a directory under the current root. Example::”h]”hŒvMounting the new root file system is easy: it just needs to be mounted on a directory under the current root. Example:”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÞhjìh²hubjË)�”}”(hŒ3# mkdir /new-root # mount -o ro /dev/hda1 /new-root”h]”hŒ3# mkdir /new-root # mount -o ro /dev/hda1 /new-root”…”�”}”hj±sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´Káhjìh²hubhÌ)�”}”(hX®The root change is accomplished with the pivot_root system call, which is also available via the ``pivot_root`` utility (see :manpage:`pivot_root(8)` man page; ``pivot_root`` is distributed with util-linux version 2.10h or higher [#f3]_). ``pivot_root`` moves the current root to a directory under the new root, and puts the new root at its place. The directory for the old root must exist before calling ``pivot_root``. Example::”h]”(hŒaThe root change is accomplished with the pivot_root system call, which is also available via the ”…”�”}”(hj¿h²hh³Nh´Nubj²)�”}”(hŒ``pivot_root``”h]”hŒ pivot_root”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj¿ubhŒ utility (see ”…”�”}”(hj¿h²hh³Nh´Nubjk)�”}”(hŒ:manpage:`pivot_root(8)`”h]”hŒ pivot_root(8)”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”jjah"]”h$]”h&]”jÚjÛjzŒ pivot_root(8)”j|Œ pivot_root”j~Œ8”uh1jjhj¿ubhŒ man page; ”…”�”}”(hj¿h²hh³Nh´Nubj²)�”}”(hŒ``pivot_root``”h]”hŒ pivot_root”…”�”}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj¿ubhŒ8 is distributed with util-linux version 2.10h or higher ”…”�”}”(hj¿h²hh³Nh´Nubj*)�”}”(hŒ[#f3]_”h]”hŒ3”…”�”}”(hjh²hh³Nh´Nubah}”(h]”Œid3”ah ]”h"]”h$]”h&]”j:Kj;Œf3”j=j>uh1j)hj¿j?KubhŒ). ”…”�”}”(hj¿h²hh³Nh´Nubj²)�”}”(hŒ``pivot_root``”h]”hŒ pivot_root”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj¿ubhŒ˜ moves the current root to a directory under the new root, and puts the new root at its place. The directory for the old root must exist before calling ”…”�”}”(hj¿h²hh³Nh´Nubj²)�”}”(hŒ``pivot_root``”h]”hŒ pivot_root”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj¿ubhŒ . Example:”…”�”}”(hj¿h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kähjìh²hubjË)�”}”(hŒ3# cd /new-root # mkdir initrd # pivot_root . initrd”h]”hŒ3# cd /new-root # mkdir initrd # pivot_root . initrd”…”�”}”hj>sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´Këhjìh²hubhÌ)�”}”(hŒÒNow, the init process may still access the old root via its executable, shared libraries, standard input/output/error, and its current root directory. All these references are dropped by the following command::”h]”hŒÑNow, the init process may still access the old root via its executable, shared libraries, standard input/output/error, and its current root directory. All these references are dropped by the following command:”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kïhjìh²hubjË)�”}”(hŒ;# exec chroot . what-follows dev/console 2>&1”h]”hŒ;# exec chroot . what-follows dev/console 2>&1”…”�”}”hjZsbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´Kôhjìh²hubhÌ)�”}”(hŒõWhere what-follows is a program under the new root, e.g. ``/sbin/init`` If the new root file system will be used with udev and has no valid ``/dev`` directory, udev must be initialized before invoking chroot in order to provide ``/dev/console``.”h]”(hŒ9Where what-follows is a program under the new root, e.g. ”…”�”}”(hjhh²hh³Nh´Nubj²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjhubhŒE If the new root file system will be used with udev and has no valid ”…”�”}”(hjhh²hh³Nh´Nubj²)�”}”(hŒ``/dev``”h]”hŒ/dev”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjhubhŒP directory, udev must be initialized before invoking chroot in order to provide ”…”�”}”(hjhh²hh³Nh´Nubj²)�”}”(hŒ``/dev/console``”h]”hŒ /dev/console”…”�”}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjhubhŒ.”…”�”}”(hjhh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Köhjìh²hubhÌ)�”}”(hŒ‹Note: implementation details of pivot_root may change with time. In order to ensure compatibility, the following points should be observed:”h]”hŒ‹Note: implementation details of pivot_root may change with time. In order to ensure compatibility, the following points should be observed:”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kûhjìh²hubjj)�”}”(hX‡- before calling pivot_root, the current directory of the invoking process should point to the new root directory - use . as the first argument, and the _relative_ path of the directory for the old root as the second argument - a chroot program must be available under the old and the new root - chroot to the new root afterwards - use relative paths for dev/console in the exec command ”h]”jç)�”}”(hhh]”(ju)�”}”(hŒobefore calling pivot_root, the current directory of the invoking process should point to the new root directory”h]”hÌ)�”}”(hŒobefore calling pivot_root, the current directory of the invoking process should point to the new root directory”h]”hŒobefore calling pivot_root, the current directory of the invoking process should point to the new root directory”…”�”}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KþhjÁubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¾ubju)�”}”(hŒmuse . as the first argument, and the _relative_ path of the directory for the old root as the second argument”h]”hÌ)�”}”(hŒmuse . as the first argument, and the _relative_ path of the directory for the old root as the second argument”h]”hŒmuse . as the first argument, and the _relative_ path of the directory for the old root as the second argument”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjÙubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¾ubju)�”}”(hŒAa chroot program must be available under the old and the new root”h]”hÌ)�”}”(hjóh]”hŒAa chroot program must be available under the old and the new root”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhjñubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¾ubju)�”}”(hŒ!chroot to the new root afterwards”h]”hÌ)�”}”(hj h]”hŒ!chroot to the new root afterwards”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¾ubju)�”}”(hŒ7use relative paths for dev/console in the exec command ”h]”hÌ)�”}”(hŒ6use relative paths for dev/console in the exec command”h]”hŒ6use relative paths for dev/console in the exec command”…”�”}”(hj# h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¾ubeh}”(h]”h ]”h"]”h$]”h&]”j7j8uh1jæh³hÊh´Kþhjºubah}”(h]”h ]”h"]”h$]”h&]”uh1jih³hÊh´Kþhjìh²hubhÌ)�”}”(hŒXNow, the initrd can be unmounted and the memory allocated by the RAM disk can be freed::”h]”hŒWNow, the initrd can be unmounted and the memory allocated by the RAM disk can be freed:”…”�”}”(hjC h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhjìh²hubjË)�”}”(hŒ1# umount /initrd # blockdev --flushbufs /dev/ram0”h]”hŒ1# umount /initrd # blockdev --flushbufs /dev/ram0”…”�”}”hjQ sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´M hjìh²hubhÌ)�”}”(hŒrIt is also possible to use initrd with an NFS-mounted root, see the :manpage:`pivot_root(8)` man page for details.”h]”(hŒDIt is also possible to use initrd with an NFS-mounted root, see the ”…”�”}”(hj_ h²hh³Nh´Nubjk)�”}”(hŒ:manpage:`pivot_root(8)`”h]”hŒ pivot_root(8)”…”�”}”(hjg h²hh³Nh´Nubah}”(h]”h ]”jjah"]”h$]”h&]”jÚjÛjzŒ pivot_root(8)”j|Œ pivot_root”j~jéuh1jjhj_ ubhŒ man page for details.”…”�”}”(hj_ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hjìh²hubeh}”(h]”Œchanging-the-root-device”ah ]”h"]”Œchanging the root device”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÓubh¶)�”}”(hhh]”(h»)�”}”(hŒUsage scenarios”h]”hŒUsage scenarios”…”�”}”(hjŒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj‰ h²hh³hÊh´MubhÌ)�”}”(hŒ–The main motivation for implementing initrd was to allow for modular kernel configuration at system installation. The procedure would work as follows:”h]”hŒ–The main motivation for implementing initrd was to allow for modular kernel configuration at system installation. The procedure would work as follows:”…”�”}”(hjš h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj‰ h²hubjj)�”}”(hX[1) system boots from floppy or other media with a minimal kernel (e.g. support for RAM disks, initrd, a.out, and the Ext2 FS) and loads initrd 2) ``/sbin/init`` determines what is needed to (1) mount the "real" root FS (i.e. device type, device drivers, file system) and (2) the distribution media (e.g. CD-ROM, network, tape, ...). This can be done by asking the user, by auto-probing, or by using a hybrid approach. 3) ``/sbin/init`` loads the necessary kernel modules 4) ``/sbin/init`` creates and populates the root file system (this doesn't have to be a very usable system yet) 5) ``/sbin/init`` invokes ``pivot_root`` to change the root file system and execs - via chroot - a program that continues the installation 6) the boot loader is installed 7) the boot loader is configured to load an initrd with the set of modules that was used to bring up the system (e.g. ``/initrd`` can be modified, then unmounted, and finally, the image is written from ``/dev/ram0`` or ``/dev/rd/0`` to a file) 8) now the system is bootable and additional installation tasks can be performed ”h]”jp)�”}”(hhh]”(ju)�”}”(hŒ‹system boots from floppy or other media with a minimal kernel (e.g. support for RAM disks, initrd, a.out, and the Ext2 FS) and loads initrd”h]”hÌ)�”}”(hŒ‹system boots from floppy or other media with a minimal kernel (e.g. support for RAM disks, initrd, a.out, and the Ext2 FS) and loads initrd”h]”hŒ‹system boots from floppy or other media with a minimal kernel (e.g. support for RAM disks, initrd, a.out, and the Ext2 FS) and loads initrd”…”�”}”(hj³ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj¯ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¬ ubju)�”}”(hX``/sbin/init`` determines what is needed to (1) mount the "real" root FS (i.e. device type, device drivers, file system) and (2) the distribution media (e.g. CD-ROM, network, tape, ...). This can be done by asking the user, by auto-probing, or by using a hybrid approach.”h]”hÌ)�”}”(hX``/sbin/init`` determines what is needed to (1) mount the "real" root FS (i.e. device type, device drivers, file system) and (2) the distribution media (e.g. CD-ROM, network, tape, ...). This can be done by asking the user, by auto-probing, or by using a hybrid approach.”h]”(j²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hjÏ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjË ubhX determines what is needed to (1) mount the “realâ€� root FS (i.e. device type, device drivers, file system) and (2) the distribution media (e.g. CD-ROM, network, tape, ...). This can be done by asking the user, by auto-probing, or by using a hybrid approach.”…”�”}”(hjË h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjÇ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¬ ubju)�”}”(hŒ1``/sbin/init`` loads the necessary kernel modules”h]”hÌ)�”}”(hjï h]”(j²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hjô h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjñ ubhŒ# loads the necessary kernel modules”…”�”}”(hjñ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhjí ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¬ ubju)�”}”(hŒl``/sbin/init`` creates and populates the root file system (this doesn't have to be a very usable system yet)”h]”hÌ)�”}”(hŒl``/sbin/init`` creates and populates the root file system (this doesn't have to be a very usable system yet)”h]”(j²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj ubhŒ` creates and populates the root file system (this doesn’t have to be a very usable system yet)”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¬ ubju)�”}”(hŒ‡``/sbin/init`` invokes ``pivot_root`` to change the root file system and execs - via chroot - a program that continues the installation”h]”hÌ)�”}”(hŒ‡``/sbin/init`` invokes ``pivot_root`` to change the root file system and execs - via chroot - a program that continues the installation”h]”(j²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hj@ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj< ubhŒ invokes ”…”�”}”(hj< h²hh³Nh´Nubj²)�”}”(hŒ``pivot_root``”h]”hŒ pivot_root”…”�”}”(hjR h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj< ubhŒb to change the root file system and execs - via chroot - a program that continues the installation”…”�”}”(hj< h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M"hj8 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¬ ubju)�”}”(hŒthe boot loader is installed”h]”hÌ)�”}”(hjr h]”hŒthe boot loader is installed”…”�”}”(hjt h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M$hjp ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¬ ubju)�”}”(hŒðthe boot loader is configured to load an initrd with the set of modules that was used to bring up the system (e.g. ``/initrd`` can be modified, then unmounted, and finally, the image is written from ``/dev/ram0`` or ``/dev/rd/0`` to a file)”h]”hÌ)�”}”(hŒðthe boot loader is configured to load an initrd with the set of modules that was used to bring up the system (e.g. ``/initrd`` can be modified, then unmounted, and finally, the image is written from ``/dev/ram0`` or ``/dev/rd/0`` to a file)”h]”(hŒsthe boot loader is configured to load an initrd with the set of modules that was used to bring up the system (e.g. ”…”�”}”(hj‹ h²hh³Nh´Nubj²)�”}”(hŒ ``/initrd``”h]”hŒ/initrd”…”�”}”(hj“ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj‹ ubhŒI can be modified, then unmounted, and finally, the image is written from ”…”�”}”(hj‹ h²hh³Nh´Nubj²)�”}”(hŒ ``/dev/ram0``”h]”hŒ /dev/ram0”…”�”}”(hj¥ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj‹ ubhŒ or ”…”�”}”(hj‹ h²hh³Nh´Nubj²)�”}”(hŒ ``/dev/rd/0``”h]”hŒ /dev/rd/0”…”�”}”(hj· h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj‹ ubhŒ to a file)”…”�”}”(hj‹ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M%hj‡ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¬ ubju)�”}”(hŒNnow the system is bootable and additional installation tasks can be performed ”h]”hÌ)�”}”(hŒMnow the system is bootable and additional installation tasks can be performed”h]”hŒMnow the system is bootable and additional installation tasks can be performed”…”�”}”(hjÙ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M)hjÕ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¬ ubeh}”(h]”h ]”h"]”h$]”h&]”jŠj‹jŒhj�jŽuh1johj¨ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jih³hÊh´Mhj‰ h²hubhÌ)�”}”(hŒ¿The key role of initrd here is to reuse the configuration data during normal system operation without requiring the use of a bloated "generic" kernel or re-compiling or re-linking the kernel.”h]”hŒÃThe key role of initrd here is to reuse the configuration data during normal system operation without requiring the use of a bloated “genericâ€� kernel or re-compiling or re-linking the kernel.”…”�”}”(hjù h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M,hj‰ h²hubhÌ)�”}”(hXÚA second scenario is for installations where Linux runs on systems with different hardware configurations in a single administrative domain. In such cases, it is desirable to generate only a small set of kernels (ideally only one) and to keep the system-specific part of configuration information as small as possible. In this case, a common initrd could be generated with all the necessary modules. Then, only ``/sbin/init`` or a file read by it would have to be different.”h]”(hX›A second scenario is for installations where Linux runs on systems with different hardware configurations in a single administrative domain. In such cases, it is desirable to generate only a small set of kernels (ideally only one) and to keep the system-specific part of configuration information as small as possible. In this case, a common initrd could be generated with all the necessary modules. Then, only ”…”�”}”(hj h²hh³Nh´Nubj²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj ubhŒ1 or a file read by it would have to be different.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M0hj‰ h²hubhÌ)�”}”(hX2A third scenario is more convenient recovery disks, because information like the location of the root FS partition doesn't have to be provided at boot time, but the system loaded from initrd can invoke a user-friendly dialog and it can also perform some sanity checks (or even some form of auto-detection).”h]”hX4A third scenario is more convenient recovery disks, because information like the location of the root FS partition doesn’t have to be provided at boot time, but the system loaded from initrd can invoke a user-friendly dialog and it can also perform some sanity checks (or even some form of auto-detection).”…”�”}”(hj' h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M8hj‰ h²hubhÌ)�”}”(hX'Last not least, CD-ROM distributors may use it for better installation from CD, e.g. by using a boot floppy and bootstrapping a bigger RAM disk via initrd from CD; or by booting via a loader like ``LOADLIN`` or directly from the CD-ROM, and loading the RAM disk from CD without need of floppies.”h]”(hŒÄLast not least, CD-ROM distributors may use it for better installation from CD, e.g. by using a boot floppy and bootstrapping a bigger RAM disk via initrd from CD; or by booting via a loader like ”…”�”}”(hj5 h²hh³Nh´Nubj²)�”}”(hŒ ``LOADLIN``”h]”hŒLOADLIN”…”�”}”(hj= h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj5 ubhŒX or directly from the CD-ROM, and loading the RAM disk from CD without need of floppies.”…”�”}”(hj5 h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M>hj‰ h²hubeh}”(h]”Œusage-scenarios”ah ]”h"]”Œusage scenarios”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mubh¶)�”}”(hhh]”(h»)�”}”(hŒObsolete root change mechanism”h]”hŒObsolete root change mechanism”…”�”}”(hj` h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj] h²hh³hÊh´MFubhÌ)�”}”(hŒ¢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.”h]”hŒ¢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.”…”�”}”(hjn h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MHhj] h²hubhÌ)�”}”(hXOIt 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.”h]”(hXIt 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 ”…”�”}”(hj| h²hh³Nh´Nubj²)�”}”(hŒ ``/initrd``”h]”hŒ/initrd”…”�”}”(hj„ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj| ubhŒ9, if such a directory exists on the new root file system.”…”�”}”(hj| h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MLhj] h²hubhÌ)�”}”(hŒ¾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.)”h]”hŒ¾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.)”…”�”}”(hjœ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MRhj] h²hubhÌ)�”}”(hŒ¹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.::”h]”hŒ¼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.:”…”�”}”(hjª h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MVhj] h²hubjË)�”}”(hŒ,# echo 0x301 >/proc/sys/kernel/real-root-dev”h]”hŒ,# echo 0x301 >/proc/sys/kernel/real-root-dev”…”�”}”hj¸ sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´MZhj] h²hubhÌ)�”}”(hŒJNote that the mechanism is incompatible with NFS and similar file systems.”h]”hŒJNote that the mechanism is incompatible with NFS and similar file systems.”…”�”}”(hjÆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M\hj] h²hubhÌ)�”}”(hŒThis old, deprecated mechanism is commonly called ``change_root``, while the new, supported mechanism is called ``pivot_root``.”h]”(hŒ2This old, deprecated mechanism is commonly called ”…”�”}”(hjÔ h²hh³Nh´Nubj²)�”}”(hŒ``change_root``”h]”hŒ change_root”…”�”}”(hjÜ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjÔ ubhŒ/, while the new, supported mechanism is called ”…”�”}”(hjÔ h²hh³Nh´Nubj²)�”}”(hŒ``pivot_root``”h]”hŒ pivot_root”…”�”}”(hjî h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjÔ ubhŒ.”…”�”}”(hjÔ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M_hj] h²hubeh}”(h]”Œobsolete-root-change-mechanism”ah ]”h"]”Œobsolete root change mechanism”ah$]”h&]”uh1hµhh·h²hh³hÊh´MFubh¶)�”}”(hhh]”(h»)�”}”(hŒ*Mixed change_root and pivot_root mechanism”h]”hŒ*Mixed change_root and pivot_root mechanism”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj h²hh³hÊh´MdubhÌ)�”}”(hŒ¡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.”h]”(hŒ In case you did not want to use ”…”�”}”(hj h²hh³Nh´Nubj²)�”}”(hŒ``root=/dev/ram0``”h]”hŒroot=/dev/ram0”…”�”}”(hj' h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj ubhŒ: to trigger the pivot_root mechanism, you may create both ”…”�”}”(hj h²hh³Nh´Nubj²)�”}”(hŒ ``/linuxrc``”h]”hŒ/linuxrc”…”�”}”(hj9 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj ubhŒ and ”…”�”}”(hj h²hh³Nh´Nubj²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hjK h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj ubhŒ in your initrd image.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mfhj h²hubhÌ)�”}”(hŒ/``/linuxrc`` would contain only the following::”h]”(j²)�”}”(hŒ ``/linuxrc``”h]”hŒ/linuxrc”…”�”}”(hjg h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjc ubhŒ" would contain only the following:”…”�”}”(hjc h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mjhj h²hubjË)�”}”(hŒb#! /bin/sh mount -n -t proc proc /proc echo 0x0100 >/proc/sys/kernel/real-root-dev umount -n /proc”h]”hŒb#! /bin/sh mount -n -t proc proc /proc echo 0x0100 >/proc/sys/kernel/real-root-dev umount -n /proc”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”jÚjÛuh1jÊh³hÊh´Mlhj h²hubhÌ)�”}”(hX"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``.”h]”(hŒ[Once linuxrc exited, the kernel would mount again your initrd as root, this time executing ”…”�”}”(hj� h²hh³Nh´Nubj²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hj• h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj� ubhŒ[. Again, it would be the duty of this init to build the right environment (maybe using the ”…”�”}”(hj� h²hh³Nh´Nubj²)�”}”(hŒ``root= device``”h]”hŒ root= device”…”�”}”(hj§ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj� ubhŒ? passed on the cmdline) before the final execution of the real ”…”�”}”(hj� h²hh³Nh´Nubj²)�”}”(hŒ``/sbin/init``”h]”hŒ /sbin/init”…”�”}”(hj¹ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hj� ubhŒ.”…”�”}”(hj� h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mqhj h²hubeh}”(h]”Œ*mixed-change-root-and-pivot-root-mechanism”ah ]”h"]”Œ*mixed change_root and pivot_root mechanism”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mdubh¶)�”}”(hhh]”(h»)�”}”(hŒ Resources”h]”hŒ Resources”…”�”}”(hjÜ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÙ h²hh³hÊh´MxubhŒfootnote”“”)�”}”(hŒtAlmesberger, Werner; "Booting Linux: The History and the Future" https://www.almesberger.net/cv/papers/ols2k-9.ps.gz”h]”(hŒlabel”“”)�”}”(hhh]”hŒ1”…”�”}”(hjò h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jð hjì h²hh³Nh´NubhÌ)�”}”(hŒtAlmesberger, Werner; "Booting Linux: The History and the Future" https://www.almesberger.net/cv/papers/ols2k-9.ps.gz”h]”(hŒEAlmesberger, Werner; “Booting Linux: The History and the Futureâ€� ”…”�”}”(hjÿ h²hh³Nh´NubhÖ)�”}”(hŒ3https://www.almesberger.net/cv/papers/ols2k-9.ps.gz”h]”hŒ3https://www.almesberger.net/cv/papers/ols2k-9.ps.gz”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j uh1hÕhjÿ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mzhjì ubeh}”(h]”j<ah ]”h"]”Œf1”ah$]”h&]”j5aj:Kj=j>uh1jê h³hÊh´MzhjÙ h²hubjë )�”}”(hŒUnewlib package (experimental), with initrd example https://www.sourceware.org/newlib/”h]”(jñ )�”}”(hhh]”hŒ2”…”�”}”(hj' h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jð hj# h²hh³Nh´NubhÌ)�”}”(hŒUnewlib package (experimental), with initrd example https://www.sourceware.org/newlib/”h]”(hŒ3newlib package (experimental), with initrd example ”…”�”}”(hj4 h²hh³Nh´NubhÖ)�”}”(hŒ"https://www.sourceware.org/newlib/”h]”hŒ"https://www.sourceware.org/newlib/”…”�”}”(hj< h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j> uh1hÕhj4 ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M|hj# ubeh}”(h]”jÿah ]”h"]”Œf2”ah$]”h&]”júaj:Kj=j>uh1jê h³hÊh´M|hjÙ h²hubjë )�”}”(hŒ`util-linux: Miscellaneous utilities for Linux https://www.kernel.org/pub/linux/utils/util-linux/”h]”(jñ )�”}”(hhh]”hŒ3”…”�”}”(hj\ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jð hjX h²hh³Nh´NubhÌ)�”}”(hŒ`util-linux: Miscellaneous utilities for Linux https://www.kernel.org/pub/linux/utils/util-linux/”h]”(hŒ.util-linux: Miscellaneous utilities for Linux ”…”�”}”(hji h²hh³Nh´NubhÖ)�”}”(hŒ2https://www.kernel.org/pub/linux/utils/util-linux/”h]”hŒ2https://www.kernel.org/pub/linux/utils/util-linux/”…”�”}”(hjq h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”js uh1hÕhji ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M~hjX ubeh}”(h]”jah ]”h"]”Œf3”ah$]”h&]”j aj:Kj=j>uh1jê h³hÊh´M~hjÙ h²hubeh}”(h]”Œ resources”ah ]”h"]”Œ resources”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mxubeh}”(h]”Œ!using-the-initial-ram-disk-initrd”ah ]”h"]”Œ#using the initial ram disk (initrd)”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jÀ Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”(Œf1”]”j+aŒf2”]”jðaŒf3”]”jauŒrefids”}”(j<]”j+ajÿ]”jðaj]”jauŒnameids”}”(jš j— j¨j¥jájÞj2j/jéjæj† jƒ jZ jW j j jÖ jÓ j’ j� j j<jU jÿjŠ juŒ nametypes”}”(jš ‰j¨‰já‰j2‰jé‰j† ‰jZ ‰j ‰jÖ ‰j’ ‰j ˆjU ˆjŠ ˆuh}”(j— h·j5j+j¥jJjÞj«j/jäjæj5jújðjƒ jìj jjW j‰ j j] jÓ j j� jÙ j<jì jÿj# jjX uŒ footnote_refs”}”(j]”j+aj]”jðaj]”jauŒ citation_refs”}”Œ autofootnotes”]”(jì j# jX eŒautofootnote_refs”]”(j+jðjeŒsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”jÎ Ks…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.