LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   kernel panic bin/sh no such file or dir (http://www.linuxquestions.org/questions/linux-general-1/kernel-panic-bin-sh-no-such-file-or-dir-816718/)

send2rawat 06-28-2010 12:18 AM

kernel panic bin/sh no such file or dir
 
while booting my linux system I'm Getting ..

exec of init (/sbin/init) failed!!!: 2
umount /inited/dev failed: 2
kernel panic - not syncing: Attemped to kill init!

and in rescue mode
I checked all things seems to be ok ... fstab, grub.conf, initrd file.
but when i do chroot /mnt/sysimage it gives

chroot: cannot execute /bin/sh: No such file or directory

I've also checked with reinstalling grub and making ld.so.cache again but doesn't work.
pls suggest what are the possible solutions.

halvy 06-28-2010 04:36 AM

Have you changed any kernel or initrds lately.. although not being able to chroot should partly cast aside this assumption.

This sounds like a fs error possibly.. how about that.. what fs is it.. ext3/4?


Have you fsck -VC it?

Was it working before.. because it sounds like something got trashed (or deleted).. but since you can't even chroot.. I suspect a fs error.. but I could be wrong.

business_kid 06-28-2010 05:02 AM

/mnt/sysimage is mainly used for installs, unless you have set it up that way.

/ is not where you think it is. So your line
kernel somekernel root=somedrive is wrong,

When the kernel is loaded, the system mounts / and then runs /sbin/init. Now it is finding what you call / but it is not /, because /sbin/init or /bin/sh cannot be found. Post your grub.conf and we can get you out of this.

send2rawat 06-29-2010 02:22 AM

here is grub.conf

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux AS (2.6.9-42.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.9-42.ELsmp.img
title Red Hat Enterprise Linux AS-up (2.6.9-42.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.EL ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.9-42.EL.img


I dont think there is something wrong in grub.conf because I've already matched with other servers.

business_kid 06-29-2010 05:24 AM

Quote:

kernel /vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/1 rhgb quiet
I've had trouble with those label things before. Do you know what partition / is on? Edit that line; when grub comes up hit e twice, and you should get an editor of sorts. change that to root=/dev/sdax where x is the number of your / partition. Return to finish, and b to boot it.

send2rawat 06-29-2010 11:42 PM

But I m not able to understand why it is giving
chroot: cannot execute /bin/sh: No such file or directory

is there any prob in bin/sh ??

send2rawat 06-30-2010 02:48 AM

checked with root=/dev/sda3 (my / drive) in grub.conf .. but still giving same error ..
I tried with making new initrd file but it says /lib/module .. no such file or dir.
I tried copying bash also (may be the bash giving the error ) ..
cp /usr/bin/bash /mnt/sysimage/bin/bash .. but was not useful.

business_kid 06-30-2010 04:19 AM

Is it looking for /bin/bash in the initrd? or when exactly does it ask for /bin/bash?

send2rawat 06-30-2010 04:39 AM

No I just googled it .. copying
It is just saying
chroot cannot execute /bin/sh: No such file or directory

while booting it gives
exec of init (/sbin/init) failed!!!: 2
umount /inited/dev failed: 2
kernel panic - not syncing: Attemped to kill init!

business_kid 07-01-2010 09:49 AM

Quote:

while booting it gives
exec of init (/sbin/init) failed!!!: 2
umount /inited/dev failed: 2
kernel panic - not syncing: Attemped to kill init!
That's your latest post. "umount /inited/dev failed" looks like a typo has got in - inited??

In post #3, I pointed out
Quote:

/ is not where you think it is. So your line
kernel somekernel root=somedrive is wrong,
Because of this, it can't find /bin/sh or /sbin/init. get rid of that label= thing in grub.conf, because you can have 2 partitions called label=/1 and then the fun really starts. Believe me, I've had it!


All times are GMT -5. The time now is 06:59 AM.