Using ed text editor for EMERGENCY
I need to edit my fstab so I can boot properly, but ed is the only edotor available. I've read the man pages, but can't figure it out.
I think I've deleted the line causing the error, but how do I save it and exit? |
w
q If you would like to make sure you hit the correct line: 1,$p will print the whole file for you. |
Hint, if you got the wrong one.
q q will quit without saving. Then open it again and type 1,$n Which will print all the lines with their line numbers. This example is from an /etc/rc.conf on the live cd I am using. Code:
1 background_dhclient="YES" 14d Then save and exit w q |
Note: it is very wise to have some passing familiarity with ed (and vi) for the very situations like this one. Even if you personally don't like to use them. There have been times when it was only my knowledge of ed which saved me from reinstalling a system which would not behave enough to use a different editor.
|
Thanks! That worked to save the fstab, but my theory didn''t fix the problem.
I mounted a drive that was plugged in via usb so that I could format it. Then I unplugged it and now it looks for it when I boot up and it says: "no such file or directory when trying to open /dev/sda1 Failed to check file system. |
Never used ed, but I'm sure I'm could if I had to. I always make sure pico or nano is installed. Very great easy to use in-console editors. You may want to see if you have one of them installed.
|
I guess my issue is different now so I'll start another thread....
|
What is currently in your fstab?
If you have a reference to /dev/sda1 make sure the last two columns are 0 and the one before that includes the keyword "noauto" |
Not sure what you mean (or do that with ed)
|
Quote:
ed is not very hard and actually will be very easy to use (at least the basics) if you have any experience with EDLIN from back in the long ago days of DOS. Nothing like a good line editor to keep it simple and make changes. |
Quote:
I just want to know what is in /etc/fstab... if you could cut and paste the whole file here it might help solve the problem. |
You may have 'vim-minimal' available.
|
Quote:
|
I can't cut and paste b/c I'm on another computer.
I think I got it. I removed the line from fstab and it works!!! |
Cool... good to know.
|
All times are GMT -5. The time now is 08:33 PM. |