LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 06-28-2010, 12:18 AM   #1
send2rawat
LQ Newbie
 
Registered: Jan 2007
Posts: 16

Rep: Reputation: 0
Unhappy 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.
 
Old 06-28-2010, 04:36 AM   #2
halvy
Member
 
Registered: Aug 2005
Location: Boston Massachussets, USA
Distribution: Anything NOT SystemD (ie. M$) related.
Posts: 917

Rep: Reputation: 41
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.
 
Old 06-28-2010, 05:02 AM   #3
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,612

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
/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.
 
Old 06-29-2010, 02:22 AM   #4
send2rawat
LQ Newbie
 
Registered: Jan 2007
Posts: 16

Original Poster
Rep: Reputation: 0
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.
 
Old 06-29-2010, 05:24 AM   #5
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,612

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
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.
 
Old 06-29-2010, 11:42 PM   #6
send2rawat
LQ Newbie
 
Registered: Jan 2007
Posts: 16

Original Poster
Rep: Reputation: 0
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 ??
 
Old 06-30-2010, 02:48 AM   #7
send2rawat
LQ Newbie
 
Registered: Jan 2007
Posts: 16

Original Poster
Rep: Reputation: 0
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.
 
Old 06-30-2010, 04:19 AM   #8
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,612

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
Is it looking for /bin/bash in the initrd? or when exactly does it ask for /bin/bash?
 
Old 06-30-2010, 04:39 AM   #9
send2rawat
LQ Newbie
 
Registered: Jan 2007
Posts: 16

Original Poster
Rep: Reputation: 0
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!
 
Old 07-01-2010, 09:49 AM   #10
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,612

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
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!
 
  


Reply

Tags
binsh, dir, file, kernel, panic


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgraded Kernel, Kernel Panic, Can't read root file system. Romanus81 Slackware 25 05-04-2008 11:45 PM
Retrieving semi-formatted data: Kernel Panic (cannot find file or dir /dev/root) majorGrey Linux - General 2 09-05-2007 05:02 AM
Q. moving /bin dir files to /dev dir?? Texas_student Linux - Software 2 03-27-2006 12:42 AM
/bin/sh: ro: No such file or directory Kernel Panic rchrismon Linux - General 2 10-29-2005 10:30 PM
kernel panic, everything in bin and sbin have astericks on them JunLitsu Linux - Software 3 11-01-2003 05:30 PM


All times are GMT -5. The time now is 08:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration