# How can I edit text in a dumb terminal



## bsdolith (Feb 25, 2012)

Hi,

I have just installed Gnome desktop on my laptop. When I was editing the /etc/rc.conf file to start GDM automatically I made a typo error like this:


```
gdm_enable=YES"
```
 (I forgot to type in ")

Now when I reboot the booting process stops when the computer tries to mount root from ufs:/dev/ada0p2.

I get the option to start a shell but while doing so the shell cannot open /etc/termcap and uses dumb terminal settings.

My problem is that I do not know how to edit /etc/rc.conf in this shell. I cannot open vi or getty or any other editor. However, I can *cat* rc.conf so that I can see my typo.

How can I go in and edit /etc/rc.conf? Should I use an editor I don't know of or can I use the Live CD?

Any help at all is very appreciated!


----------



## ahavatar (Feb 25, 2012)

Could you choose a single user mode during booting time? You can mount /usr partition 
`# mount -a -t ufs`
and use vi to edit /etc/rc.conf.


----------



## bsdolith (Feb 25, 2012)

Hi,

I followed this link:

http://www.freebsd.org/doc/en_US.ISO...CCONF-READONLY

and these instructions:

Restart the system using *boot -s* at the loader prompt to enter Single User mode. When prompted for a shell pathname, simply press Enter, and run *mount -urw /* to re-mount the root file system in read/write mode. You may also need to run *mount -a -t ufs* to mount the file system where your favorite editor is defined.

That solved the problem for me  Thanks for your help!


----------



## _martin (Feb 25, 2012)

Usually setting the correct environment variable (TERM) fixes this situation. But there's another nice way to fix it. 

As you said you made a typo and have 


```
gdm_enable=YES"
```

in /etc/rc.conf. If / is mounted read-write, you could do: 

`# printf "/^gdm_enable/s/.*/gdm_enable=\"YES\"/\nw\nq" | ed -s /etc/rc.conf`

and modify the file with ed editor. If all goes OK, file is modified silently.


----------



## bsdolith (Feb 27, 2012)

Sorry for the late reply but thanks for your quick help! 

I'm impressed you know all this stuff.


----------

