Problem with freebsd-update corrupting /etc/passwd

Paul Schmehl pschmehl_lists at
Fri Aug 21 03:23:56 UTC 2015

--On August 20, 2015 at 11:03:04 PM -0400 Simon <simon at> wrote:

> On Thu, 20 Aug 2015 15:01:09 -0500, Mark Felder wrote:
>> On Thu, Aug 20, 2015, at 14:17, Paul Schmehl wrote:
>>> I just upgraded two servers from 8.4-RELEASE to 10.2-RELEASE.  On both
>>> servers I had a problem with the /etc/passwd file after upgrade.
>>> This is what I got on both servers:
>>> # pwd_mkdb -C /etc/passwd
>>> pwd_mkdb: corrupted entry
>>> pwd_mkdb: at line #3
>>> pwd_mkdb: /etc/passwd: Inappropriate file type or format
>>> On one server a single user "disappeared" (getent passwd username
>>> returned
>>> nothing).  On the other server, after I replaced it with
>>> /etc/masster.passwd, I looped through the /etc/passwd file and getent
>>> returned each entry, so no users "disappeared".
>>> Not sure what the problem might be, but I thought y'all should know.
>> During the upgrade did it ask you to merge some config files (passwd
>> included) ? That's the only time it would do so. Corruption on line #3
>> makes me think it was trying to make you manually merge the FreeBSD ID /
>> timestamp at the top of the file.
> Unless something went wrong, it would ask, I bet that's where his
> corruption comes from. When I did 8.4->10.1-R upgrade using
> freebsd-update, it would ask me to merge both /etc/passwd and
> /etc/master.passwd manually He should look at /etc/passwd to see what's
> on line 3 and fix it :)
> -Simon

Nope.  Turns out the /etc/passwd file is *supposed* to be in Version 7 
format, which pwd_mkdb sees as corrupt when reading it with the -C swith. 
At least that's what the pwd_mkdb man page says.

IOW, there was nothing wrong with the files after all, and I still have no 
idea how the one account just "disappeared" according to getent.

Paul Schmehl, Retired
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
"There are some ideas so wrong that only a very
intelligent person could believe in them." George Orwell

More information about the freebsd-questions mailing list