Subject: Re: passwd - what to do?
To: None <bwildasi@csulb.edu>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 04/28/1997 17:55:16
> 
> Does anyone know how to fix this? I've tried most of the suggestions
> mentioned so far, but nothing's worked yet. I've run into a snag trying
> to "add a new user", ie myself, to the new netBSD 1.2D/mac68k (4/7/97
> current & GENERICSB27) system i've loaded on a Q700 macintosh.
>  
> order of events thus far
> 
> booting ...multiuser mode
> ...automatic boot in progress: ...
> automatic file system check failed; help!
> sh
> vt220
> mount
> root_device on / type ffs (local, read-only)
> mount -u /
> /dev/sd2a: file system not clean; please fsck(8)

Ack! If it complained that the file system was dirty, fsck it! Don't
mount it.

> fsck  (y to all questions)

Did you just fsck a mounted file system?????? VERY BAD.
I bet all hell is going to break loose next boot.

What's happening is that when a filesystem is mounted (using a block
device), there is a disk buffer cache. When fsck goes out and cleans a
filesystem, it accesses the character or "raw" device which doesn't
have the buffer.  So you can get into inconcistancy problems. Basically
when you shut down, you write out to disk all the stuff fsck tried to
clean up.

The way to get yourself out of this mess is to boot single user, do NOT
mount anything, fsck /dev/sd2a, and reboot immediately. Then you're
set for the next boot.

> pwd
> /root
> cd /
> mount
> /dev/sd2a on / type ffs (local)
> cd etc
> rm passwd pwd.db spwd.db ptmp
> vi group   (wheel:*:0:root,brian)
> 	:w
> 	:q
> vipw      (brian:**:1000:0::0:0:brian wildasinn:/home/brian:/bin/sh)
> 	:w
> 	:q
> mkdir /home/brian  /usr/home/brian
> ln -s /usr/home /home
> chown -R brian /home/brian
> chown:brian: illegal user name
> passwd brian
> passwd: unknown user brian
> 
> Well ...as you can see i won't be able to configure the system until
> this little ditty is resolved. By the way, i down loaded netBSD's
> adduser and adduser.sh programs which stop at just this same "illegal
> and unknown" user ...me.

I'm not sure what's up here. It should all work. Try chaging your
password after creating your user record. That should force a
database rebuild.

Let us know how it goes after you fix the file system.

Take care,

Bill