I use genkernel, which produces an initrd. None of the standard kernel parameters for entering single user mode seem to work. I tried researching this, and one out-dated wiki (http://www.gentoo-wiki.info/TIP_Booting_into_single_user_mode), suggested adding init_opts=1 instead. That doesn't work either. One of Gentoo's strengths is its extensive documentation, but this rather important detail is missing. Please add it to the manual somewhere. Thanks.
Gentoo Linux does not define a single user mode. There is the boot, default and the usual administrative runlevels. The usual way that works on (probably) all Linux distros is to set init=/path/to/some/binary, usually init=/bin/bash or =/bin/bb, which serves as sort of a rescue system.
I don't use genkernel, but it seems like 'init_opts=single' is supposed to work. Did you set up /etc/runlevel/single with a suitable subset of your normal boot services? Note that if you use this 'init=/bin/bash' technique, filesystems will still be mounted read-only so they need to be remounted writable before fixing anything, e.g. mount / -o remount,rw
All I'm saying is that whatever your recovery mode is, it needs to be documented. It's been years since I built my Gentoo box, so I don't remember what I did. Whatever was in the manual in 2008. If the base layout or instructions included something about level S, then it's there. Note that I did indeed want to boot in read-only mode. Instead, I booted up normally, and there's no way I can fully assess the damage as a result. I really needed to get this right the first time. And it's also interesting that 'init_opts=single' is yet another option for single user mode that I haven't seen elsewhere, although it is a recombination of other things I've seen. We need to figure out what is the TRUTH and include that in the docs, key-worded in such a way the if someone googles "gentoo single user mode" they'll get that page.
(In reply to comment #1) > Gentoo Linux does not define a single user mode. There is the boot, default > and the usual administrative runlevels. > > The usual way that works on (probably) all Linux distros is to set > init=/path/to/some/binary, usually init=/bin/bash or =/bin/bb, which serves > as sort of a rescue system. this. if someone really wants single user mode, googling is probably the best way of figuring it out, as there doesn't seem to be a real standard. me, i just edit grub.conf and change my kernel line to append "single" after the usual /vmlinuz stuff. but then, i don't use genkernel.
These docs are also wrong about how to get into single user mode: http://www.gentoo.org/doc/en/handbook/draft/complete/handbook.xml?part=2&chap=7 My bug report was about missing/incorrect documentation. That still stands. Unless you're saying that docs on gentoo.org are not official.
I tried adding "init=/bin/bash" to the kernel command line. That doesn't work at all. It just boots up normally. Since I am using genkernel which makes an initrd (and no one is saying that I shouldn't be using genkernel), I tried "real_init=/bin/bash". That gives me a kernel panic after a statement that /bin/bash doesn't exist. Bottom line: So far, I have not found any way to get into a single-user or recovery mode for Gentoo using genkernel. I've also looked through your bug database and found plenty of other complaints pertaining to single-user mode being unavailable. Why is something so important being overlooked?
I've also tried "init=/bin/bb" and "real_init=/bin/bb". The former has no effect, while the latter panics after /bin/bb reports that it "can't open ''".
If I boot my genkernel-powered VMs with the additional option "init_opts=S" then openrc goes to the recovery mode (i.e. asking for the root password and giving a system with minimal amount of running services). Using "real_init=/bin/bash" should work, but it's quite difficult to debug why it doesn't. I guess that bash has some dependencies (dynamic) that can't be properly resolved. I tried with a static-built dash, and it returns just "0: cannot open", but that might be SELinux playing with me. In general, if you use an initramfs, you should use the "rescue" options that the initramfs provides; genkernel doesn't provide any yet (dracut does). Where would you suggest that we put this kind of information? There's some blurb about recover in the gentoo FAQ, so I'm inclined to put information there.
Changes committed to genkernel guide