On 01/12/13 07:25, Marc Espie wrote:
On Sat, Jan 12, 2013 at 07:17:25AM -0500, Scott McEachern wrote:
On 01/11/13 16:38, Paolo Aglialoro wrote:
sparc64 machine, a neglected typo in fstab while changing a disk mountpoint
and boom! - no boot :(


ed(1) isn't hard to use, but if you haven't used it in a while, as
espie@ said, having another machine handy to hit the man page is
useful.  Go play with ed(1) now when you aren't in "panic mode" to
get a feel for it.

However, if you really feel the need to use vi, then do something like this:

1) use disklabel(8) to see what partition on your HDD contains the
/usr partition.  vi(1) lives in /usr/bin, so I'm assuming you don't
have /usr/bin/ mounted somewhere other than /usr.

Pretend it's on partition 'f' of sd0.  Let's also pretend your root
partition is on 'a'.

2) #mount /dev/sd0a /
#mount /dev/sd0f /usr

If you run vi now, it'll bitch about your terminal type not being set, so:

3) #export TERM=vt220 (or whatever is applicable to you)

4) #vi /etc/fstab (fix your mistake(s))

5) #reboot
Did you actually test that ? vi wants /var/tmp rw as well...


Nah, just going from memory. It's been a while. However, the same logic applies: Look at what partition /var is on and mount it too.

But thanks for illustrating my point: It's just easier to learn a little ed(1) when not panicking in single-user mode. I'm also assuming that his _only_ problem is a typo (or whatever) in fstab, otherwise things get more complicated. :)

--
Scott McEachern

https://www.blackstaff.ca

Reply via email to