Lines Matching +full:- +full:- +full:root
9 This RAM disk can then be mounted as the root file system and programs
10 can be run from it. Afterwards, a new root file system can be mounted
11 from a different device. The previous root (from initrd) is then moved
15 where the kernel comes up with a minimum set of compiled-in drivers, and
23 ---------
30 3) if the root device is not ``/dev/ram0``, the old (deprecated)
31 change_root procedure is followed. see the "Obsolete root change
33 4) root device is mounted. if it is ``/dev/ram0``, the initrd image is
34 then mounted as root
38 6) init mounts the "real" root file system
39 7) init places the root file system at the root directory using the
41 8) init execs the ``/sbin/init`` on the new root filesystem, performing
45 Note that changing the root directory does not involve unmounting it.
51 Boot command-line options
52 -------------------------
65 the "normal" root file system is mounted. initrd data can be read
70 Note: /dev/initrd is read-only and it can only be used once. As soon
74 root=/dev/ram0
76 initrd is mounted as root, and the normal boot procedure is followed,
77 with the RAM disk mounted as root.
80 ----------------------
88 find . | cpio --quiet -H newc -o | gzip -9 -n > /boot/imagefile.img
94 gzip -cd /boot/imagefile.img | cpio -imd --quiet
97 ------------
100 "normal" root file system, e.g.::
107 If the root file system is created during the boot procedure (i.e. if
108 you're building an install floppy), the root file system creation
127 - a floppy disk (works everywhere but it's painfully slow)
128 - a RAM disk (fast, but allocates physical memory)
129 - a loopback device (the most elegant solution)
137 # mke2fs -F -m0 initrd
142 # mount -t ext2 -o loop initrd /mnt
171 # gzip -9 initrd
183 root=/dev/ram0 rw
193 LOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0 rw
201 append = "root=/dev/ram0 rw"
210 Changing the root device
211 ------------------------
213 When finished with its duties, init typically changes the root device
214 and proceeds with starting the Linux system on the "real" root device.
217 - mounting the new root file system
218 - turning it into the root file system
219 - removing all accesses to the old (initrd) root file system
220 - unmounting the initrd file system and de-allocating the RAM disk
222 Mounting the new root file system is easy: it just needs to be mounted on
223 a directory under the current root. Example::
225 # mkdir /new-root
226 # mount -o ro /dev/hda1 /new-root
228 The root change is accomplished with the pivot_root system call, which
230 man page; ``pivot_root`` is distributed with util-linux version 2.10h or higher
231 [#f3]_). ``pivot_root`` moves the current root to a directory under the new
232 root, and puts the new root at its place. The directory for the old root
235 # cd /new-root
239 Now, the init process may still access the old root via its
241 current root directory. All these references are dropped by the
244 # exec chroot . what-follows <dev/console >dev/console 2>&1
246 Where what-follows is a program under the new root, e.g. ``/sbin/init``
247 If the new root file system will be used with udev and has no valid
254 - before calling pivot_root, the current directory of the invoking
255 process should point to the new root directory
256 - use . as the first argument, and the _relative_ path of the directory
257 for the old root as the second argument
258 - a chroot program must be available under the old and the new root
259 - chroot to the new root afterwards
260 - use relative paths for dev/console in the exec command
266 # blockdev --flushbufs /dev/ram0
268 It is also possible to use initrd with an NFS-mounted root, see the
273 ---------------
282 2) ``/sbin/init`` determines what is needed to (1) mount the "real" root FS
284 distribution media (e.g. CD-ROM, network, tape, ...). This can be
285 done by asking the user, by auto-probing, or by using a hybrid
288 4) ``/sbin/init`` creates and populates the root file system (this doesn't
290 5) ``/sbin/init`` invokes ``pivot_root`` to change the root file system and
291 execs - via chroot - a program that continues the installation
300 The key role of initrd here is to re-use the configuration data during
302 kernel or re-compiling or re-linking the kernel.
307 (ideally only one) and to keep the system-specific part of configuration
313 like the location of the root FS partition doesn't have to be provided at
314 boot time, but the system loaded from initrd can invoke a user-friendly
316 auto-detection).
318 Last not least, CD-ROM distributors may use it for better installation
321 from the CD-ROM, and loading the RAM disk from CD without need of
325 Obsolete root change mechanism
326 ------------------------------
332 It works by mounting the "real" root device (i.e. the one set with rdev
333 in the kernel image or with root=... at the boot command line) as the
334 root file system when linuxrc exits. The initrd file system is then
336 such a directory exists on the new root file system.
339 command options root, init, or rw. (If specified, they will affect
340 the real root file system, not the initrd environment.)
342 If /proc is mounted, the "real" root device can be changed from within
343 linuxrc by writing the number of the new root FS device to the special
344 file /proc/sys/kernel/real-root-dev, e.g.::
346 # echo 0x301 >/proc/sys/kernel/real-root-dev
356 ------------------------------------------
358 In case you did not want to use ``root=/dev/ram0`` to trigger the pivot_root
365 mount -n -t proc proc /proc
366 echo 0x0100 >/proc/sys/kernel/real-root-dev
367 umount -n /proc
369 Once linuxrc exited, the kernel would mount again your initrd as root,
371 to build the right environment (maybe using the ``root= device`` passed on
376 ---------
379 https://www.almesberger.net/cv/papers/ols2k-9.ps.gz
382 .. [#f3] util-linux: Miscellaneous utilities for Linux
383 https://www.kernel.org/pub/linux/utils/util-linux/