Recovery after pwd.db corruption ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Recovery after pwd.db corruption ?

Denis Fondras
Hello,

After a power-loss, my server rebooted and gave at start :

----
starting network daemons: sshdMar 23 07:59:40 su: /etc/pwd.db:
Inappropriate file type or format
(failed) smtpdMar 23 07:59:41 su: /etc/pwd.db: Inappropriate file type
or format
(failed).
starting local daemons: cronMar 23 07:59:41 su: /etc/pwd.db:
Inappropriate file type or format
(failed).

OpenBSD/socppc (asphyx) (console)

login: root
Password:
Login incorrect
login:

----

Is there a way to repair without putting out the drive ?
(it is an OpenBSD5.4 on a RB600a)

Thank you in advance,
Denis

Reply | Threaded
Open this post in threaded view
|

Re: Recovery after pwd.db corruption ?

Theo de Raadt
The following recipe might help:

   boot bsd.rd
   (s) for shell

   fsck your root filesystem
   mount your root filesystem on /mnt
   fsck the filesystems specified in /mnt/etc/fstab

   Mount at least your /usr partition, but on /mnt/usr
   You will need it to run the pwd_mkdb command

   Run the following:

   /mnt/usr/sbin/pwd_mkdb -d /mnt/etc master.passwd

Good luck.

There is a simpler path of course.  Do an upgrade to the same era of
code you were running.  Behind the scenes, it will perform this
same action.

> After a power-loss, my server rebooted and gave at start :
>
> ----
> starting network daemons: sshdMar 23 07:59:40 su: /etc/pwd.db:
> Inappropriate file type or format
> (failed) smtpdMar 23 07:59:41 su: /etc/pwd.db: Inappropriate file type
> or format
> (failed).
> starting local daemons: cronMar 23 07:59:41 su: /etc/pwd.db:
> Inappropriate file type or format
> (failed).
>
> OpenBSD/socppc (asphyx) (console)
>
> login: root
> Password:
> Login incorrect
> login:
>
> ----
>
> Is there a way to repair without putting out the drive ?
> (it is an OpenBSD5.4 on a RB600a)
>
> Thank you in advance,
> Denis

Reply | Threaded
Open this post in threaded view
|

Re: Recovery after pwd.db corruption ?

Ted Unangst-6
In reply to this post by Denis Fondras
On Sun, Mar 23, 2014 at 22:02, Denis Fondras wrote:
> Hello,
>
> After a power-loss, my server rebooted and gave at start :
>
> ----
> starting network daemons: sshdMar 23 07:59:40 su: /etc/pwd.db:
> Inappropriate file type or format
> (failed) smtpdMar 23 07:59:41 su: /etc/pwd.db: Inappropriate file type

If /etc/master.passwd is still whole, run pwd_mkdb /etc/master.passwd.

Reply | Threaded
Open this post in threaded view
|

Re: Recovery after pwd.db corruption ?

Denis Fondras
Thank you very much Ted & Theo ! :)