[opensuse] Booting with a shell in initrd with systemd
Hi list, I installed openSUSE 12.1 on an PC-Engines Alix system board, which uses the pata_amd driver to access its compact flash disk. Since I installed the system on a virtual machine before putting the flash in the real hardware, the driver was not included in the initrd image and obviously I couldn't see the disk on the real hardware. Booting the compact flash in the virtual machine and rebuilding the initrd image with the driver included solved the issue. However, I tried quite hard to get a shell early during the boot process, in the initrd environment, before trying to mount anything, but failed. I tried the various "Single", "S", "1", "init=/bin/bash", etc, as in older systems, but none stopped before trying to mount /dev/sda1. Then I tried "systemd.unit=emergency.target", but that didn't stop before trying to mount the disk. Since I'm very new to systemd, I'd like to know how to get a shell as early as possible during the boot process in order to easily troubleshoot situations where rootfs (or even the whole disk) is not accessible at boot time for some reason. Thanks, Javier -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tuesday 22 November 2011, Javier Conti wrote:
Hi list,
I installed openSUSE 12.1 on an PC-Engines Alix system board, which uses the pata_amd driver to access its compact flash disk. Since I installed the system on a virtual machine before putting the flash in the real hardware, the driver was not included in the initrd image and obviously I couldn't see the disk on the real hardware. Booting the compact flash in the virtual machine and rebuilding the initrd image with the driver included solved the issue.
However, I tried quite hard to get a shell early during the boot process, in the initrd environment, before trying to mount anything, but failed. I tried the various "Single", "S", "1", "init=/bin/bash", etc, as in older systems, but none stopped before trying to mount /dev/sda1. Then I tried "systemd.unit=emergency.target", but that didn't stop before trying to mount the disk.
Since I'm very new to systemd
Could you do it with sysvinit? It should not make a difference.
, I'd like to know how to get a shell as early as possible during the boot process in order to easily troubleshoot situations where rootfs (or even the whole disk) is not accessible at boot time for some reason.
I don't think there is a proposed way to get interactive shell within initrd via grub command line parameters. You could do the trick by editing root=/dev/sda1 to root=/dev/null then mounting fails with no delay and leaves you with interactive bash. (root=/dev/non-existent would work too but with long timeout). BTW the default initrd is not a comfortable rescue system. To make it more useful you should include a busybox binary at least. cu, Rudi -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 23 November 2011 15:25, Ruediger Meier <sweet_f_a@gmx.de> wrote:
On Tuesday 22 November 2011, Javier Conti wrote:
Hi list,
I installed openSUSE 12.1 on an PC-Engines Alix system board, which uses the pata_amd driver to access its compact flash disk. Since I installed the system on a virtual machine before putting the flash in the real hardware, the driver was not included in the initrd image and obviously I couldn't see the disk on the real hardware. Booting the compact flash in the virtual machine and rebuilding the initrd image with the driver included solved the issue.
However, I tried quite hard to get a shell early during the boot process, in the initrd environment, before trying to mount anything, but failed. I tried the various "Single", "S", "1", "init=/bin/bash", etc, as in older systems, but none stopped before trying to mount /dev/sda1. Then I tried "systemd.unit=emergency.target", but that didn't stop before trying to mount the disk.
Since I'm very new to systemd
Could you do it with sysvinit? It should not make a difference.
, I'd like to know how to get a shell as early as possible during the boot process in order to easily troubleshoot situations where rootfs (or even the whole disk) is not accessible at boot time for some reason.
I don't think there is a proposed way to get interactive shell within initrd via grub command line parameters.
You could do the trick by editing root=/dev/sda1 to root=/dev/null
Hi Ruediger, I finally had the chance to test it, and using "root=/dev/null init=/bin/bash" works fine.
From there, I'm at least able to mount filesystems and see what's going on.
Thanks, Javier
then mounting fails with no delay and leaves you with interactive bash. (root=/dev/non-existent would work too but with long timeout).
BTW the default initrd is not a comfortable rescue system. To make it more useful you should include a busybox binary at least.
cu, Rudi -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 22/11/11 19:12, Javier Conti wrote:
However, I tried quite hard to get a shell early during the boot process, in the initrd environment, before trying to mount anything, but failed.
"To boot directly into emergency shell add systemd.unit=emergency.target or emergency to the kernel command line" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 28 November 2011 19:08, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
On 22/11/11 19:12, Javier Conti wrote:
However, I tried quite hard to get a shell early during the boot process, in the initrd environment, before trying to mount anything, but failed.
"To boot directly into emergency shell add systemd.unit=emergency.target or emergency to the kernel command line"
As I said in my original post, that is one of the first things I tried. Obviously, it didn't work (and still doesn't work if I try to reproduce the problem). Ciao, Javier
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Cristian Rodríguez
-
Javier Conti
-
Ruediger Meier