# help with corrupted files



## Ron (Oct 19, 2009)

Greetings,

I'm hopeful that someone might help with the following problem:

I was attempting to set up automated login for a user and following, or trying to follow, something I found on Google. As a result, I made entries to /etc/gettytab and /etc/ttys.  Now I can no longer boot.

All is not lost because I have a clone of the primary master hdd on the primary slave hdd and could recover with dd.  However I would loose a few important bookmarks and a few files I haven't put on the slave.

If I were to switch the drives, then boot from what was the slave, could I somehow copy the good gettytab and ttys files to the now slave, overwriting the corrupted files ? I would then switch drives again to get back where I was. Or, is there another approach?

Any help is appreciated.


----------



## vivek (Oct 19, 2009)

You need to boot in a single user mode. Mount all partition or /etc at least. Edit /etc/gettytab and /etc/ttys. Save and close the file. Reboot the box. To boot into a single mode type the following command at boot: promot

```
boot -s
```

See this link. It describe booting and mounting file system (skip passwd command instead use vi to edit the files)
http://www.cyberciti.biz/tips/howto-freebsd-reset-recover-root-password.html


----------



## Ron (Oct 19, 2009)

I had entered single user mode, but didn't know about remounting the root file system. After doing fsck all went well and I was able to edit out the lines I had inserted. Thanks for educating me.


----------

