LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-24-2009, 06:40 PM   #1
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Rep: Reputation: 0
Smile my bash file is deleted , trying to restore from kernel arguments


hi,
i have deleted my bash file
and thus the system is not letting me to bash shell
now i have a kernel panic situation
i want to log in using ksh shell passing arguments from kernel
lets begin..
 
Old 09-24-2009, 06:43 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Please tell us which distro & version you have, and give more details.
Which 'bash' file?

1. /bin/bash - the actual shell itself
2. .bashrc
3. .bash_profile
4. other
 
Old 09-24-2009, 06:52 PM   #3
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 0
yeah you got it right
its the /bin/bash file
i am using RHEL5
 
Old 09-24-2009, 06:55 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
I'd use the installation DVD in rescue mode ie at the first text prompt type

linux rescue


then it will run from the DVD & mount your HDD as another disk. You can fix your login to use /bin/ksh or whatever so you can at least get in.
You should then be able to use yum to re-install bash.
 
Old 09-24-2009, 07:02 PM   #5
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,971
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
Quote:
Originally Posted by miteshpant View Post
yeah you got it right
its the /bin/bash file
i am using RHEL5
boot into "linux rescue" mode from the installation disc

Then you can do 1 of 2 things...

Reinstall bash

Copy bash from the rescue mode

-C
 
Old 09-25-2009, 04:44 AM   #6
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 0
the point is i don't want to use the dvd , or linux rescue mode... i want to fx it by passing arguments from the kernel to get into the computer using ksh shell
 
Old 09-25-2009, 04:52 AM   #7
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by miteshpant View Post
the point is i don't want to use the dvd , or linux rescue mode... i want to fx it by passing arguments from the kernel to get into the computer using ksh shell
So this is homework. If I were in your shoes I would use the simplest, most reliable way to recover from such a disaster (e.g. copy bash from a rescue disk to the affected installation). But you don't want to do that. Ergo, homework.

Be truthful.
 
Old 09-25-2009, 11:47 AM   #8
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,971
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
Quote:
Originally Posted by miteshpant View Post
the point is i don't want to use the dvd , or linux rescue mode... i want to fx it by passing arguments from the kernel to get into the computer using ksh shell
Do you mean passing options to the kernel using grub?

-C
 
Old 09-25-2009, 12:28 PM   #9
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 0
correct
i think something like
init=/bin/ksh should work
 
Old 09-25-2009, 01:19 PM   #10
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,971
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
Quote:
Originally Posted by miteshpant View Post
correct
i think something like
init=/bin/ksh should work
It might...try it out and let us know if it worked.

-C
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accidentally deleted config file....how to restore it? gauravholey Linux - Kernel 4 06-22-2009 08:53 AM
restore deleted rc.conf file fraggelfraggel *BSD 7 10-23-2005 12:53 AM
reinstalling windows deleted my grub master boot file; how do I restore it? sohmc Linux - General 3 01-12-2005 02:27 PM
How to restore a deleted file satimis Linux - Newbie 1 09-12-2003 05:18 AM
restore back deleted file edreddy Linux - General 4 07-19-2002 07:43 AM


All times are GMT -5. The time now is 08:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration