LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-13-2004, 04:45 PM   #1
mwarren2
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Rep: Reputation: 0
Rescue problem - How do I edit /etc/fstab without vi?


I had a corrupt file system problem, and had to run fsck manually. (Debian Linux).
In order to do so, I had to stop the system mounting the various /dev/hda5, /dev/hda6,/dev/hd7 because otherwise fsck said it couldn't repair them because they were in use, not even with the -f option.

So I changed /etc/fstab, and gated with # the three lines that mounted them.
Big mistake, as it now turns out.
I managed to repair the file system manually, but...... I can't put anything back as it was.

I can now boot up to a certain point, where the system asks me for the root password for maintenance. I have the root file system mounted, but nothing else. This means that I can roam about the root file system, and I can cat /etc/fstab, but without vi I can't put it back as it was.

How can I edit /etc/fstab to put everything back to normal? - I only have the use of programmes in /bin and /sbin, none of which enable me to edit.

I have tried creating a rescue floppy disk from Windows, which is working normally, so I have access to the web (hence this post) and the rescue floppy correctly started the system, but rescueing the root disk from the floppy just brought me to the same point as booting normally. i.e. no editing programmes.


Any help appreciated, I see to be in a big hole here.
 
Old 08-13-2004, 04:58 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
You could cat it ...
then echo individual lines into /etc/fstab.new
echo "blurb blurb .... 1 1" > /etc/fstab.new
echo "blurb2 blurb2 .... 1 1" >> /etc/fstab.new

And once it looks as desired, cp it over? :)

Or, if your machine is like mine, use sed or
awk to make life easier ;)


Cheers,
Tink

Last edited by Tinkster; 08-13-2004 at 04:59 PM.
 
Old 08-13-2004, 05:01 PM   #3
mwarren2
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks, that looks like what I needed.

I'll give it a try.
 
Old 08-13-2004, 05:02 PM   #4
gplacek
Member
 
Registered: Aug 2004
Location: Atlanta
Distribution: Slackware
Posts: 56

Rep: Reputation: 15
you mean the / or the /root dir? vi should be in your /bin unless its some /bin thats mounted on a floppy? So you are saying that you can not boot to any of your linux partitions, just off a floppy? /bin/vi and /bin/ed are in my /bin. It sounds like your /dev/hd? is mounted in your /. I dont know much about Debain, I've never used it. It seems like your saying you can boot your system? There should be editors in /bin. I know there is in mine. Tell us more about what you are trying to do. Just edit your /etc/fstab, or start x11? From wht you say it sounds like you have access to your system, and not the network?
 
Old 08-13-2004, 05:03 PM   #5
gplacek
Member
 
Registered: Aug 2004
Location: Atlanta
Distribution: Slackware
Posts: 56

Rep: Reputation: 15
opps ... heh heh .. disreguard all that I wrote.. heh heh :-)
 
Old 08-13-2004, 05:11 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Quote:
Originally posted by mwarren2
Thanks, that looks like what I needed.

I'll give it a try.
Pleasure mate, keep us posted!


Cheers,
Tink
 
Old 08-13-2004, 05:38 PM   #7
mwarren2
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
I'm posting this from Linux - my problem is solved and everything seems back to normal.
Thanks for the help.

I see that I have sed and awk in my /bin folder, but in the event I used echo like you suggested.

Thanks.
 
Old 08-13-2004, 05:46 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Congratulations! :)

Cheers,
Tink
 
  


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
Edit file from Rescue Mode? tdog Linux - General 3 10-29-2005 01:59 PM
How do I edit /etc/fstab? linusownsme Linux - Software 9 03-05-2005 11:30 AM
Help me edit my fstab Slovak Slackware 3 11-26-2004 10:12 AM
Edit file in rescue mode DanielTan Linux - Newbie 1 09-19-2004 11:44 AM
edit fstab LinuxOG Linux - Distributions 2 09-01-2003 10:27 AM


All times are GMT -5. The time now is 09:43 PM.

Main Menu
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