LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 05: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, 05:43 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 05: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, 05:55 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 06:02 PM   #5
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
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, 03: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, 03: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, 10:47 AM   #8
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
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, 11:28 AM   #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, 12:19 PM   #10
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
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



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 07:53 AM
restore deleted rc.conf file fraggelfraggel *BSD 7 10-22-2005 11:53 PM
reinstalling windows deleted my grub master boot file; how do I restore it? sohmc Linux - General 3 01-12-2005 01:27 PM
How to restore a deleted file satimis Linux - Newbie 1 09-12-2003 04:18 AM
restore back deleted file edreddy Linux - General 4 07-19-2002 06:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:22 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
Open Source Consulting | Domain Registration