fsck deleted /etc/passwd on 3b2

Karl Kleinpaste karl at triceratops.cis.ohio-state.edu
Sat Aug 27 01:02:55 AEST 1988


narem-james at yale.uucp writes:
     Fsck deleted /etc/passwd on boot of my 3b2.  It now will not let
   anyone login.  Is there anything else that can be done besides reload
   unix?  I can get to the firmware monitor.

Put in your Essential floppy #1, boot it, it'll give you a short (4
item?) menu.  Ignore the possibilities it suggests, type "magic mode"
instead.  Yes, I'm serious.  Your 3B2 will respond with "POOF" (yes,
I'm serious again) and an updated menu that allows for a local shell.
Request the local shell.  You now have an EXTREMELY limited UNIX
system.  Your variables are almost unquestionably wrong, notably PATH.
Cruise around your miniature UNIX system with `cd' and `echo' to see
what you've got available (believe me, it ain't much).  When you find
commands you need to execute, give full pathnames, to avoid PATH
confusion.  There exist some delicate operations now for fsck'ing your
root disc (do it again, just for safety), then mounting it.  I think
the mounting command is called `fsys' in this mode.  Change your PATH
and anything else you find relevant at this point so that you can act
reasonably.  If you get this far, and if your real root disc partition
is now hypothetically mounted on the floppy's /tmp, then you can execute
	/tmp/bin/cat > /tmp/etc/passwd
Give yourself a one-line passwd file:
	root::0:0:Administrator:/:
then sync discs, unmount, and shutdown as carefully/gracefully as you
can.  Reboot without the floppy in place and you should be back to
normal operation, albeit you will have this abbreviated passwd file
which you will need to replace.

I haven't had to do this in some time, so details may be a bit fuzzy.

--Karl



More information about the Comp.sys.att mailing list