I am using a kernel generated with genkernel. In order to boot into single user mode, I tried adding the following on the kernel line in my grub.conf file: real_init 1 (substituting single or S1 for 1 gives the same results) The boot process is halted after a few seconds with the following error: switch_root Bad init '1' (single or S1) Attempt to kill init kernel panik. If I do not use the initramfs and substitute real_root by root, real_init 1 by 1 and delete the ramdisk entry, the system boots into single mode fine. However, I need to be able to use the initrd image as I am using lvm and luks. Reproducible: Always Steps to Reproduce: 1.add real_root 1 on the kernel line in grub.conf 2.reboot 3. Actual Results: kernel panik Expected Results: system boots into single user mode Searching for information on the use of real_init I get mixed results: a) some references seem to indicate that it defines the runlevel to boot into b) others seem to indicate that it defines a program used as init
You used real_init 1 and not real_init=1 ?
Sorry, I used real_init=1, and got the results outlined above.
+1, happening here too, using real_init=1 appended to my kernel boot line in grub. Damn annoying as there's no other way to get into single user mode :-(
I tracked this down to: /usr/share/genkernel/generic/linuxrc e.g. the genkernel command line parser. Line 627 exec switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}" "real_init" is just that, where is the real init script? The kernel option we should use is init_opts=1 to set single user run level.
Has anyone tried to boot with 'single', 'softlevel=single', or something like that?
(In reply to comment #5) > Has anyone tried to boot with 'single', 'softlevel=single', or something like > that? Yes, and I was not able to get it to work with the grub initrd startup.
Have tried booting with some init_opts= options. And most work for me. My test system had sys-kernel/genkernel-3.4.10-r1 BTW. Here is what I got: Single user mode: init_opts=s >>> OK init_opts=S >>> OK init_opts=single >>> OK Emergency mode (init spawns sulogin, no checkfs, mount, ...) init_opts=emergency >>> OK init_opts=-b >>> Doesn't work (Suppose some problem with the "-". Maybe an issue with switch_root from busybox). BTW, genkernel uses a different scheme for cmdline options than any other initramfs/initrd out there. I think this has been the root of confusion.
I had the same problem. "real_init", "softlevel", and "1" did not work for me. However, adding "emergency" to the end of my grub options did. Seeing how old this ticket is (and I believe it now has a solution), should it be closed?
Could someone confirm that the cmdline options in comment #7 work?
I am running a vanilla kernel (not genkernel), however here are my results: Note: These options were simply appended to my grub command (no "init_opts=" used). emergency = works -b = works s = works S = works single = works Please mark this bug as resolved.
You don't use an initramfs/initrd, so in your test case the kernel runs directly the init process. This process is passed all the non-filtered cmdline parameters. The filtered ones are all that have the "=" sign and the ones interpreted by the kernel (for example: noht, nosmp, noapic,...). So all the usual init arguments (s, S, emergency, ...) work for you ;). This bug is about genkernel. In this case, the kernel runs first the init from genkernel. Afterwards, the real init is started. With the arguments supplied as init_opts. I tried all the init arguments and commented my results. They should be similar for other people. But before closing the bug, it should be better someone confirm they are in fact the same.
I think this bug can be closed. I use genkernel to generate my kernel and I had to reboot my Gentoo single-user (to extend and resize the LVM filesystem that houses my /usr partition) and could not get it to work by appending "single" to the kernel grub line on boot. I searched and ran across this bug, which provided the solution. Adding init_opts=single to the grub boot line worked for me.
> I think this bug can be closed. > ... > Adding init_opts=single to the grub boot line worked for me. I am using genkernel with initrd and this also works for me. However, I only knew to try it after reading every message attached to this bug report! This is going to remain a problem until the Bootloader Configuration section of the Gentoo Linux Genkernel Guide describes the init_opts parameter. It already has info on the real_root parameter, so this seems like an appropriate place to me.
Please reassign this bug to the documentation project. I see now that the Genkernel Guide is no longer maintained. The Gentoo Handbook, which is maintained, has example grub.conf files for users booting without initrd and also for genkernel users booting with initrd. The non-initrd non-genkernel example (code listing 2.3) includes a rescue option while the genkernel initrd example (code listing 2.4) does not. Genkernel users occasionally require single user mode and there is _no_ documentation available describing how to enter single user mode with genkernel w/ initrd. Therefore, I request that a rescue or single user option be added to Gentoo Handbook code listing 2.4. This option should use either real_init=/bin/bb or init_opts=single.