You are not logged in.

#1 2007-11-30 03:11:37

abstracity
Member
From: Houston, USA
Registered: 2007-08-08
Posts: 83

Attempting init=/bin/bash; getting kernel panic instead

Hi everyone.  I'm trying to diagnose pm-utils by following the advice they give at opensuse.org: add "init=/bin/bash" to grub and test out all the different combinations from there.  Well, I have always gotten a kernel panic when attempting this on my JFS-formatted Core2Duo laptop and on my reiserfs desktop.  I have tryed with both the fallback image and the image I normally use but the same error comes up.  Here is the message I get when appending "init=bin/bash" to the kernel line in menu.lst.

:: Running Hook [filesystems]
:: Leading root filesystem module ... jfs
JFS: nTxBlock=7842,nTxLock = 62739
Waiting for devices to settle... done
:: Initramfs completed - control passing to kinit
IP-Config: no devices to configure
Waiting 0 s before mounting root device...
kinit: Mounted root (jfs filesystem) readonly.
bash: root=/dev/sda3: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

My root device is /dev/sda3 as well as init being in /sbin/init.  Here is the /boot/grub/menu.lst file I tryed to use (I used the fallback image on this one).

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=773 init=/bin/bash
initrd /kernel26-fallback.img

Here is the kernel26-fallback.conf that generated the /boot/kernel26-fallback.img I tryed to boot with.

MODULES="ata_generic ata_piix"
#BINARIES=""
FILES=""
HOOKS="base udev pata scsi sata usbinput keymap filesystems"

I took note of phrakture's advice from this thread from over a year ago, and added "break=y" to my grub config file, menu.lst.  It worked and I was able to be dropped into dash.  Now, I'm just trying to figure out how I can use the same functionality that I would normally have if I used the "init=/bin/bash" kernel parameter, so I can go about testing suspend on my machine.

And right before I posted this, I thought to try adding all important modules in the "MODULES" array in the above file, including "jfs", and after generating a new kernel image, it didn't work.  Maybe I needed to remove udev from the hooks...

I don't know whether or not I should report this as a bug.. but thank you for reading anyway. smile


Without error there can be no brilliancy. ― Emanuel Lasker

Offline

#2 2007-11-30 18:00:26

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Attempting init=/bin/bash; getting kernel panic instead

What mkinitcpio version are you using?

The latest version (which might, actually, be unreleased) will fail gracefully at this point. It says something to the effect of "Can't find root device, failing to prompt. If your root device appears here, try adding rootdelay=X to your kernel boot parameters".

So, in essence, if /dev/sda3 exists after you break=y, it simply means it's loading and trying to mount too fast. Add rootdelay=5 (for 5 seconds) and see if that helps.

Offline

#3 2007-11-30 23:07:22

abstracity
Member
From: Houston, USA
Registered: 2007-08-08
Posts: 83

Re: Attempting init=/bin/bash; getting kernel panic instead

I was getting the error message I typed up below with mkinitcpio 0.5.17-1, the latest one in the core repository.  I tryed to append "rootdelay=5" along with the original "init=/bin/bash" to the fallback image on both my desktop system formatted with reiserfs and on my laptop formatted with jfs; I also tryed "rootdelay=15".  Both "rootdelay=5" and "rootdelay=15" outputed the same response as the panic message I gave originally on both the laptop and the desktop.  They would wait for either 5 or 15 seconds for "devices to settle," based upon which one I had set in the kernel parameter:

Waiting for devices to settle...done

The full output was same as before:

:: Running Hook [filesystems]
:: Leading root filesystem module ...jfs
JFS: nTxBlock = 7842, nTxLock = 62739
Waiting for devices to settle...done.
:: Initramfs completed - control passing to kinit
IP-Config: no devices to configure
Waiting 0 s before mounting root device...
kinit: Mounted root (jfs filesystem) readonly.
bash: root=/dev/sda3: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

(The ouput on the reiserfs system was slightly different, but it was essentially the same.)

I then tested this procedure on an older version of mkinitcpio (0.5.15-2...it's the only other one I have) that was in my /var/cache/pacman/pkg/ folder, first on my desktop system.

# pacman -Rd mkinitcpio
# pacman -U /var/cache/pacman/pkg/mkinitcpio-0.5.15-2-i686.pkg.tar.gz

My original /etc/mkinitcpio.d/kernel26-fallback.conf didn't differ from the default one of the older-new mkinitcpio I was installing, so it did not create a ".pacsave" file out of it; it only left it there.
I then generated the /boot/kernel26-fallback.img file and rebooted.

# mkinitcpio -k 2.6.23-ARCH -c /etc/mkinitcpio.d/kernel26-fallback.conf -g /boot/kernel26-fallback.img
# reboot

The "Arch Linux Fallback" menu option, on boot, looked like this after I had edited the "kernel" line:

root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=773 init=/bin/bash rootdelay=5
initrd /kernel26-fallback.img

These kernel parameters gave the exact "kernel panic" output as the other several attempts did:

:: Running Hook [filesystems]
:: Leading root filesystem module ...jfs
JFS: nTxBlock = 7842, nTxLock = 62739
Waiting for devices to settle...done.
:: Initramfs completed - control passing to kinit
IP-Config: no devices to configure
Waiting 0 s before mounting root device...
kinit: Mounted root (jfs filesystem) readonly.
bash: root=/dev/sda3: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

I experienced this error message after tagging the kernel line with "init=/bin/bash rootdelay=5" on both the reiserfs and jfs systems.  Each time the system would pause and wait for the indicated number of seconds given on the "rootdelay" field, with the following line being echoed during this waiting period:

Waiting for devices to settle...done

I then tryed "init=/bin/bash rootdelay=15" on both systems again as well as removing the "rootdelay" parameter entirely but still got the same above result.

Removing all of the parameters allows me to boot normally, as if nothing was wrong, on my laptop, but on my desktop, the kernel26-fallback.conf was not wanting to boot even with "init=/bin/bash rootdelay=5" removed (this was with the kernel26-fallback.img file generated with mkinitcpio 0.5.15-2).  I regret not writing down the output and I apoligize sincerely for this; the error message given was similar to what you had told me in your previous post:

Can't find root device, failing to prompt. If your root device appears here, try adding rootdelay=X to your kernel boot parameters.

It indicated I should add "rootdelay=8" to the kernel options, and above that were also instructions stating to try appending "rootfstype=X" to the kernel field.  Even though this was an old mkinitcpio version and the latest one, 0.5.17-1, works perfectly fine for me, I just thought I'd show you what the boot prompt looked like just in case:

root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=773 init=/bin/bash rootdelay=8 rootfstype=reiserfs
initrd /kernel26-fallback.img

Upon boot, it would output something like:

:: Running Hook
:: Running reiserfs filesystem hook

I apoligize again that I cannot explain to you exactly what it said, but it did look something like that, and it was a kernel panic I believe..
I also tryed many different combinations such as only adding "rootdelay=8", "rootdelay=15", "rootfstype=reiserfs rootdelay=8", "rootfstype=reiserfs rootdelay=15", and last, only "rootfstype=reiserfs".  They showed the same response as above, so I upgraded to the newest mkinitcpio version, 0.5.17-1, with "pacman -Syu", and everything went back to normal and is running fine with kernel26-fallback.img.

Also, as an add-in-note, upon a successful boot my machine outputs:

:: Running Hook [filesystems]
:: Leading root filesystem module ...jfs
JFS: nTxBlock = 7842, nTxLock = 62739
Waiting for devices to settle...done.
:: Initramfs completed - control passing to kinit
IP-Config: no devices to configure
Waiting 0 s before mounting root device...
kinit: Mounted root (jfs filesystem) readonly.
INIT: Version 2.68 booting...

(There may have been another line in between the last two.)

So that's pretty much the entire walkthrough of what happens when I try to boot with init=/bin/bash.  My laptop is a third-generation MacBook 2.16 GHz Intel Core 2 Duo (T7200 / T7400) ... it reads "T7400" from /proc/cpuinfo, with a Serial ATA hard drive which loads "libata," "ata_generic," "ata_piix," "sr_mod," and "sd_mod" upon every boot.  My desktop reiserfs system also boots from a Serial ATA drive and loads those same modules upon initialization.  If you need any more information, then please let me know.  I am willing to work with you to narrow this problem down.

And also, as an another, another note.. I tryed switching the "ro" field on both systems to "rw", but that didn't do anything either..

EDIT: I just now took a look at this post and discovered part of the error message I didn't write down... but this was with the old mkinitcpio version (0.5.15-2), so I do not know if it is relevant.  The message doesn't contain the "rootdelay=8" bit that was shown to me during my own sessions.

Loading root filesystem module...
Attempting to create root device name for '/dev/sda2
unknown
ERROR: root fs cannot be detected. Try using the rootfstype=kernel parameter

Waiting for device to settle...done
Root device '/dev/sda2' doesn`t exist, attempting to create it
ERROR: Failed to parse block device name for '/dev/sda2'
ERROR: Unable to create/detect root device '/dev/sda2'
Dropping to a recovery shell
NOTE: klibc contains no 'ls' binary
.
.
.
ramfs$

Last edited by abstracity (2007-11-30 23:28:20)


Without error there can be no brilliancy. ― Emanuel Lasker

Offline

#4 2007-12-01 01:29:08

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Attempting init=/bin/bash; getting kernel panic instead

abstracity wrote:
:: Running Hook [filesystems]
:: Leading root filesystem module ...jfs
JFS: nTxBlock = 7842, nTxLock = 62739
Waiting for devices to settle...done.
:: Initramfs completed - control passing to kinit
IP-Config: no devices to configure
Waiting 0 s before mounting root device...
kinit: Mounted root (jfs filesystem) readonly.
bash: root=/dev/sda3: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

Oh man, I just noticed something. Take a look at this line:
bash: root=/dev/sda3: No such file or directory

That's not an error from the initramfs, it's an error from bash itself!

My guess is that _somehow_ the "init" parameter is being set to more than it should be.

Can you do me a favor and "break=y" then "echo $init"?

It that fails, perhaps try to add "init=/bin/bash" as the _very last_ argument to the kernel params

Offline

#5 2007-12-01 03:14:04

abstracity
Member
From: Houston, USA
Registered: 2007-08-08
Posts: 83

Re: Attempting init=/bin/bash; getting kernel panic instead

Using the latest, non-cvs version of mkinitcpio (0.5.17-1) and the /boot/kernel26-fallback.img file generated from mkinitcpio, I attempted to make it into dash with the following kernel line:

root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=773 break=y
initrd /kernel26-fallback.img

It seemed as if I did.  Here is the typed-up output I received (the last portion of it) up to the dash prompt.

:: Running Hook [fw]
:: Running Hook [keymap]
:: Loading keymap...Cannot find default font
done.
:: Running Hook [filesystems]
:: Leading root filesystem module ...jfs
JFS: nTxBlock = 7842, nTxLock = 62739
Waiting for devices to settle...done.
:: Break requested, type 'exit' to resume operation
    NOTE: klibc contains no 'ls' binary, use 'echo *' instead
ramfs$

I then proceeded to follow your instruction to input 'echo $init', and this is all I received.

ramfs$ echo $init

ramfs$ echo $INIT

It turns out that I didn't get anything back after trying the command or its case modification.
I rebooted, and moved to trying out your second plan, adding "init=/bin/bash" as the very last argument to the kernel parameters.

ramfs$ reboot

Here is the new kernel boot line:

root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=773 init=/bin/bash
initrd /kernel26-fallback.img

I received the panic I had gotten before.

:: Running Hook [filesystems]
:: Leading root filesystem module ...jfs
JFS: nTxBlock = 7842, nTxLock = 62739
Waiting for devices to settle...done.
:: Initramfs completed - control passing to kinit
IP-Config: no devices to configure
Waiting 0 s before mounting root device...
kinit: Mounted root (jfs filesystem) readonly.
bash: root=/dev/sda3: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

I then put "rootdelay=5", this time, in front of "init=/bin/bash".

root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=773 rootdelay=5 init=/bin/bash
initrd /kernel26-fallback.img

I received the exact "kernel panic" message I did before.

:: Running Hook [filesystems]
:: Leading root filesystem module ...jfs
JFS: nTxBlock = 7842, nTxLock = 62739
Waiting for devices to settle...done.
:: Initramfs completed - control passing to kinit
IP-Config: no devices to configure
Waiting 0 s before mounting root device...
kinit: Mounted root (jfs filesystem) readonly.
bash: root=/dev/sda3: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

This time I tryed with "rootdelay=15".

root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=773 rootdelay=15 init=/bin/bash
initrd /kernel26-fallback.img

I get the same "kernel panic" message as above, with the difference being that is pauses longer on "Waiting 0 s before mounting root device..."

Here is the /etc/mkinitcpio.d/kernel26-fallback.conf file I used to generate /boot/kernel26-fallback.img with "mkinitcpio -k 2.6.23-ARCH -c /etc/mkinitcpio.d/kernel26-fallback.conf -g /boot/kernel26-fallback.img"

MODULES="ata_generic ata_piix"
#BINARIES=""
FILES=""
HOOKS="base udev pata scsi sata usbinput keymap filesystems"

All this was tested on my MacBook 2.16 GHz Intel Core 2 Duo (T7200 / T7400) with a Serial ATA hard drive.

Last edited by abstracity (2007-12-01 03:21:06)


Without error there can be no brilliancy. ― Emanuel Lasker

Offline

#6 2007-12-01 19:09:59

fi-dschi
Member
Registered: 2007-09-16
Posts: 19

Re: Attempting init=/bin/bash; getting kernel panic instead

Hello there
I get the same error on an IDE-driven ext3 root fs. As I am not that familiar with linux, please let me know if some lines from any log file or similar may help solve the problem.

Thank you
fi-dschi

EDIT:
I have just retried break=y and now can report some new experience:
The minishell (dash?) displays the prompt and freezes when starting with default kernel.
With the fallback kernel it seems to start correctly. $init is empty.

Last edited by fi-dschi (2007-12-01 19:20:36)

Offline

#7 2007-12-02 16:53:18

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: Attempting init=/bin/bash; getting kernel panic instead

I'm having the same problem. I've tried rolling back to the mkinitcpio-0.5.15-2 and kernel26-2.6.23.1-6 just in case but that didn't help.

My root fs is reiserfs and my boot partition is ext3.

the line from menu.1st is:

kernel /vmlinuz26 root=/dev/sda5 ro break=y init=/bin/bash

When booting I get

waiting for devices to settle ...done
ERROR: Failed to parse block device name for '/dev/sda5'
unknown
ERROR: root fs cannot be detected. Try using he rootfskernel parameter
:: Break requested

etc

echo $init gives

/bin/bash

Last edited by dninja (2007-12-02 16:53:54)

Offline

#8 2007-12-04 10:09:10

abstracity
Member
From: Houston, USA
Registered: 2007-08-08
Posts: 83

Re: Attempting init=/bin/bash; getting kernel panic instead

I have filed a bug report regarding this malfunction.  The URL is given below:

http://bugs.archlinux.org/task/8832


Without error there can be no brilliancy. ― Emanuel Lasker

Offline

#9 2007-12-04 14:46:46

zodmaner
Member
Registered: 2007-07-11
Posts: 653

Re: Attempting init=/bin/bash; getting kernel panic instead

I also had this happen to me just a moment ago on my ext3 hard disk! sad

Well, on the bright side it was a software error and not a hardware problem. I'll try and see if I can reproduce it.

Last edited by zodmaner (2007-12-04 14:47:12)

Offline

#10 2007-12-05 09:24:58

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: Attempting init=/bin/bash; getting kernel panic instead

I desparately need a fix, I'm currently having to boot my machine from a live cd then mount stuff up and chroot into the original machine!

Apart from the hassle, I could cope with it for a while except for some reason, vim is now accepting mouse clicks rather than them just focusing on the window. I try to drag over some text and it goes into visual insert mode!

Offline

#11 2007-12-05 10:41:01

Finkregh
Member
From: Germany/Hannover
Registered: 2007-12-04
Posts: 44

Re: Attempting init=/bin/bash; getting kernel panic instead

OT:

dninja wrote:

Apart from the hassle, I could cope with it for a while except for some reason, vim is now accepting mouse clicks rather than them just focusing on the window. I try to drag over some text and it goes into visual insert mode!

try a
set mouse=
inside your vimrc/running vim

Offline

#12 2007-12-08 15:48:33

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: Attempting init=/bin/bash; getting kernel panic instead

I've fixed it!

These are the steps I took...

Boot a live cd
mount my root, and boot partitions.
mount with bind option /sys into the mounted root - don't know if this helped but mkinitcpio complained that it couldn't find /sys/devices and this step removed that error
chroot into the mounted root
rolled back bash which forced me to rollback hwdetect and filesystem.
I reinstalled the kernel so that mkinitcpio was ran then rebooted and it all worked!

I don't know which package killed it, hwdetect, filesystem or bash, I'll have to see what happens next time one is available for an upgrade.

If anyone else needs help with fixing there system let me know, I don't know how much help I can be but I'll try.

Offline

#13 2007-12-10 15:24:05

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: Attempting init=/bin/bash; getting kernel panic instead

I've just upgraded a laptop and hit a very similar problem but this time the error was a kernel error, something about dereferencing a null pointer and TSC timers.

Again, I had to rollback bash, hwdetect and filesystem.

This was on a new laptop which only had arch installed on it two weeks ago so no legacy stuff lying around to be corrupted by upgrades. Is it just me being unlucky or are other people getting this? Which of the three packages is likely to be the broken one and is it likely to be fixed any time soon? I have a third machine that I need to upgrade but I'm not touching it till I know what is going on as I can't afford more down time.

Offline

#14 2007-12-10 16:24:50

abstracity
Member
From: Houston, USA
Registered: 2007-08-08
Posts: 83

Re: Attempting init=/bin/bash; getting kernel panic instead

Post another message about this incident in the bug report we were conversing at, or start a new one, as your problem is different from mine; if you are experiencing this fault repeatedly, then this really warrants its own bug report.


Without error there can be no brilliancy. ― Emanuel Lasker

Offline

#15 2009-01-03 11:18:15

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 702

Re: Attempting init=/bin/bash; getting kernel panic instead

I have exactly the same problem when trying to add init=/bin/bash to kernel parameters in /boot/grub/menu.lst file. To make sure I'm not making any mistakes with typing wrong letters i.e., I've copied my main Arch boot entry, removed parameters regarding Splashy, renamed it to "s2RAM" and of course added the aforementioned parameter at the end. Here's my menu.lst

# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst

# DEVICE NAME CONVERSIONS 
#
#  Linux           Grub
# -------------------------
#  /dev/fd0        (fd0)
#  /dev/hda        (hd0)
#  /dev/hdb2       (hd1,1)
#  /dev/hda3       (hd0,2)
#

#  FRAMEBUFFER RESOLUTION SETTINGS
#     +-------------------------------------------------+
#          | 640x480    800x600    1024x768   1280x1024
#      ----+--------------------------------------------
#      256 | 0x301=769  0x303=771  0x305=773   0x307=775
#      32K | 0x310=784  0x313=787  0x316=790   0x319=793
#      64K | 0x311=785  0x314=788  0x317=791   0x31A=794
#      16M | 0x312=786  0x315=789  0x318=792   0x31B=795
#     +-------------------------------------------------+

# general configuration:
timeout   15
default   0
## Splash image! 
splashimage /grub/splashimages/splash1.xpm.gz
color light-blue/black light-cyan/blue

# boot sections follow
# each is implicitly numbered from 0 in the order of appearance below
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*

# (0) Arch Linux
title  Arch Linux
root   (hd0,4)
kernel /vmlinuz26 root=/dev/disk/by-uuid/8b3e10c8-d868-4d49-82b3-a906fb63768b ro agp=off quiet vga=792 splash
initrd /kernel26.img elevator=deadline

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,4)
kernel /vmlinuz26 root=/dev/disk/by-uuid/8b3e10c8-d868-4d49-82b3-a906fb63768b ro
initrd /kernel26-fallback.img elevator=deadline

# (1) Windows
title Windows Vista Home Premium SP1
rootnoverify (hd0,1)
makeactive
chainloader +1

# (0) s2RAM
title  s2RAM
root   (hd0,4)
kernel /vmlinuz26 root=/dev/disk/by-uuid/8b3e10c8-d868-4d49-82b3-a906fb63768b ro init=/bin/bash
initrd /kernel26.img elevator=deadline

The first entry works flawlessly, the last one gives me a kernel panic

(...)
kinit: Mounted root (jfs filesystem) readonly.
bash: root=/dev/disk/by-uuid/8b3e10c8-d868-4d49-82b3-a906fb63768b: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

I'm trying to investigate s2RAM and therefore I need a solution here.


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

Board footer

Powered by FluxBB