# Lost use of system after mergemaster



## griffinelly (Sep 9, 2011)

This is the first time this has happened to me but, I've screwed when trying to merge /etc/passwd and /etc/group files. Now the system services don't start and neither my or the root user can log in. 

I have booted into single user mode to see if I can find a way of fixing it, the truth is I don't know where to start. 

Can anyone give me some help? Is there a way I can sort this without taking drastic action like reinstalling?


----------



## DutchDaemon (Sep 9, 2011)

See what's in /var/backups/ and see if you can work with that. Other than that, of course you have backups of /etc/ somewhere.


----------



## anomie (Sep 9, 2011)

If you've not installed a lot of Ports (read: services with service accounts), you can probably grab a stock /etc/passwd and/or someone can provide you with one. 

And - as mentioned above - it's absolutely critical to take an /etc backup _before_ messing with mergemaster(8). Simple as: 
`# tar cfz /etc-bkup.tgz /etc`


----------



## aragon (Sep 10, 2011)

You really don't need to reinstall.  Just rebuild your password database.  For ports with their own accounts, check /usr/ports/UIDs to see what UID/GID they need.

Use vipw(8) if you edit the password database manually.  If you're editing /etc/passwd directly or with a script, use cap_mkdb(1) to rebuild the hashed password databases.


----------



## griffinelly (Sep 11, 2011)

Thanks for your replies, really helpful info. It took me a while to get there but I managed it by playing with aragon's suggestions. I am a fool as I did NOT keep a back-up of /etc. I made the mistake of thinking that as I've been through buildworld so many times that I wouldn't run into problems. I won't be making that mistake again!


----------

