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. |
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 |
Thanks, that looks like what I needed.
I'll give it a try. |
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?
|
opps ... heh heh .. disreguard all that I wrote.. heh heh :-)
|
Quote:
Cheers, Tink |
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. |
Congratulations! :)
Cheers, Tink |
All times are GMT -5. The time now is 06:25 PM. |