From owner-freebsd-questions Sat Mar 1 16:31:38 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B843637B401 for ; Sat, 1 Mar 2003 16:31:37 -0800 (PST) Received: from mukappabeta.net (moghedien.mukappabeta.net [194.145.150.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8929243F93 for ; Sat, 1 Mar 2003 16:31:36 -0800 (PST) (envelope-from mkb@mukappabeta.de) Received: by mukappabeta.net (Postfix, from userid 1000) id 6ECFC3440C; Sun, 2 Mar 2003 01:31:31 +0100 (CET) Date: Sun, 2 Mar 2003 01:31:28 +0100 From: Matthias Buelow To: freebsd-questions@freebsd.org Subject: Re: recover /etc/passwd from pwd.db Message-ID: <20030302003128.GA7146@moghedien.mukappabeta.net> References: <20030228195647.GA751@reiher.informatik.uni-wuerzburg.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030228195647.GA751@reiher.informatik.uni-wuerzburg.de> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I wrote: >after the latest crash of 5.0-p2/i386, my /etc/passwd and >/etc/master.passwd are trashed (I used chsh just before the crash). >My user line is missing in passwd, and the master.passwd file is >just binary garbage. pwd.db and spwd.db however seem to be ok. >How can I recover the text files from the databases? >pwd_mkdb(8) talks about creating a v7 style passwd file via the >-p option but I don't know what to pass as file argument, if I >do pwd_mkdb -p /etc/pwd.db I get: Following up my own mail, I found at least one solution in the meantime; there was a proper backup of master.passwd in /var/backups; and on that file pwd_mkdb worked. The question remains, however, what to do in the case when only the databases are left and all textual files are trashed. Surely there must be a way to create the text files from the db? -- Matthias Buelow To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message