Linux documentation admin guide init rst

Linux documentation admin guide init rst

You are using an outdated browser. Please upgrade your browser to improve your experience and security.

Check our new training course

Linux debugging, tracing, profiling & perf. analysis

Elixir Cross Referencer

 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
Explaining the "No working init found." boot hang message ========================================================= :Authors: Andreas Mohr Cristian Souza This document provides some high-level reasons for failure (listed roughly in order of execution) to load the init binary. 1) **Unable to mount root FS**: Set "debug" kernel parameter (in bootloader config file or CONFIG_CMDLINE) to get more detailed kernel messages. 2) **init binary doesn't exist on rootfs**: Make sure you have the correct root FS type (and ``root=`` kernel parameter points to the correct partition), required drivers such as storage hardware (such as SCSI or USB!) and filesystem (ext3, jffs2, etc.) are builtin (alternatively as modules, to be pre-loaded by an initrd). 3) **Broken console device**: Possibly a conflict in ``console= setup`` --> initial console unavailable. E.g. some serial consoles are unreliable due to serial IRQ issues (e.g. missing interrupt-based configuration). Try using a different ``console= device`` or e.g. ``netconsole=``. 4) **Binary exists but dependencies not available**: E.g. required library dependencies of the init binary such as ``/lib/ld-linux.so.2`` missing or broken. Use ``readelf -d |grep NEEDED`` to find out which libraries are required. 5) **Binary cannot be loaded**: Make sure the binary's architecture matches your hardware. E.g. i386 vs. x86_64 mismatch, or trying to load x86 on ARM hardware. In case you tried loading a non-binary file here (shell script?), you should make sure that the script specifies an interpreter in its shebang header line (``#!/. ``) that is fully working (including its library dependencies). And before tackling scripts, better first test a simple non-script binary such as ``/bin/sh`` and confirm its successful execution. To find out more, add code ``to init/main.c`` to display kernel_execve()s return values. Please extend this explanation whenever you find new failure causes (after all loading the init binary is a CRITICAL and hard transition step which needs to be made as painless as possible), then submit a patch to LKML. Further TODOs: - Implement the various ``run_init_process()`` invocations via a struct array which can then store the ``kernel_execve()`` result value and on failure log it all by iterating over **all** results (very important usability fix). - Try to make the implementation itself more helpful in general, e.g. by providing additional error messages at affected places.

Источник

Читайте также:  Grub linux has invalid signature

Linux documentation admin guide init rst

Using the initial RAM disk (initrd) =================================== Written 1996,2000 by Werner Almesberger and Hans Lermen initrd 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. 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. This document gives a brief overview of the use of initrd. A more detailed discussion of the boot process can be found in [#f1]_. Operation ——— 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. 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 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. Boot command-line options ————————- initrd adds the following new options:: initrd=

(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. Compressed cpio images ———————- Recent 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):: find . | cpio —quiet -H newc -o | gzip -9 -n > /boot/imagefile.img Examining the contents of an existing image file is just as simple:: mkdir /tmp/imagefile cd /tmp/imagefile gzip -cd /boot/imagefile.img | cpio -imd —quiet Installation ———— First, a directory for the initrd file system has to be created on the «normal» root file system, e.g. # mkdir /initrd The name is not relevant. More details can be found on the :manpage:`pivot_root(2)` man page. 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. If initrd will not be mounted in some cases, its content is still accessible if the following device has been created:: # mknod /dev/initrd b 1 250 # chmod 400 /dev/initrd 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. Third, 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: — 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) We’ll describe the loopback device method: 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 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. 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:: root=/dev/ram0 rw (rw is only necessary if writing to the initrd file system.) With LOADLIN, you simply execute:: LOADLIN initrd= e.g. LOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0 rw With LILO, you add the option «INITRD=

Читайте также:  Linux mint настроить переключение клавиатуры

Источник

Ошибка при установке Ubuntu Server 20.04 (Ошибка при распаковке Initramfs: нет волшебства cpio)

Я новичок в Linux, поэтому не имею ни малейшего представления о том, что означает какое-либо сообщение об ошибке. Я получаю следующее сообщение:

[0.424931] Initramfs unpacking failed: no cpio magic [0.984686] Failed to execute /init (error -2) [0.984730] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. [0.984789] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.4.0-26-generic #30-Ubuntu [0.984789] Hardware name: MotherBoard By ZOTAC MotherBoard Z77ITX-A-E/Z77ITX-A-E, BIOS A229P007 06/05/2012 [0.984816] Call Trace: [0.984840] dump_stack+0x6d/0x9a [0.984862] ? rest_init+0x30/0xb0 [0.984883] panic+0x101/0x2e3 [0.984904] ? do_execve+0x25/0x30 [0.984924] ? rest_init+0xb0/0xb0 [0.984965] kernel_init+0xfb/0x100 [0.984965] ret_from_fork+0x35/0x40 [0.985039] Kernel Offset: 0x17600000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [0.985069] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ]--- 

Я просмотрел https://www.kernel.org/doc/Documentation/admin-guide/init.rst , и мне это действительно не помогло. потому что я новичок в Linux. Я устанавливаю с USB-накопителя, и я пробовал каждый USB-порт на своем компьютере (USB 3 и 2).

1 ответ

На всякий случай, если вы не разрешили его и/или кому-то еще интересно — у меня была такая же проблема с Server 20.04, когда я использовал 512 МБ ОЗУ на старом настольном компьютере Lenovo (самая старая машина AMD64, которую я когда-либо видел — пришлось отключить APIC и LAPIC). Извлечение 512 МБ и добавление 2 ГБ ОЗУ решило проблему и не приводит к сбою установщика из-за паники ядра.

Классический случай не очень полезного (хотя, вероятно, точного) сообщения об ошибке. Надеюсь это поможет!

Другие вопросы по тегам:

Похожие вопросы:

  • Установка Ubuntu-Linux на Virtualbox (виртуальная машина) — 5 September 2013 15:37
  • Почему zpool не установлен на сервере Ubuntu 16.04? [dубликат] — 27 October 2016 12:44
  • Ubuntu 16.04 загружается на черный экран с мигающим курсором при добавлении дополнительных жестких дисков — 23 May 2016 05:43
  • Снижение сбоев ядра — 12 November 2018 15:02
  • какие пакеты удалить для лучшей безопасности? — 5 June 2012 05:51
  • Ошибка при попытке скомпилировать ядро ​​2.6.37 — 9 July 2012 18:08
  • Как найти версию linux-generic, которая соответствует определенной версии ядра? — 20 October 2017 00:17
Читайте также:  Remove all spaces linux

Источник

Оцените статью
Adblock
detector