From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 27 22:31:20 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BECA316A403 for ; Wed, 27 Sep 2006 22:31:20 +0000 (UTC) (envelope-from dking@ketralnis.com) Received: from ketralnis.com (melchoir.ketralnis.com [68.183.67.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3C0D43D68 for ; Wed, 27 Sep 2006 22:31:08 +0000 (GMT) (envelope-from dking@ketralnis.com) Received: from [192.168.1.31] (pix.xythos.com [64.154.218.194]) (authenticated bits=0) by ketralnis.com (8.13.6/8.13.6) with ESMTP id k8RMV7eX090152 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Wed, 27 Sep 2006 15:31:07 -0700 (PDT) (envelope-from dking@ketralnis.com) Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <200609261121.k8QBLRSP041907@lurza.secnetix.de> References: <200609261121.k8QBLRSP041907@lurza.secnetix.de> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <43827BA9-D59C-4C5E-8727-2DF7AFE8F939@ketralnis.com> Content-Transfer-Encoding: 7bit From: David King Date: Wed, 27 Sep 2006 15:30:44 -0700 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.752.2) Subject: Re: fsck X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Sep 2006 22:31:20 -0000 >> And now for something completely different.... If I can't get the / >> usr >> partition to work is there any way to recreate the user >> directories from >> the password file? The contents will be lost but nobody uses their >> folder >> anyway, I just need all the /usr/home folders created... I could >> write a >> script, but I thought I'd check first to see if something already >> exists....... > That's trivial. In /bin/sh syntax: > # cd /home > # awk -F: '$3>999{print $1}' /etc/passwd | xargs mkdir > # for i in *; do chown $i:$i $i; done It might help to copy the stuff out of /usr/share/skel, too, like this (untested): cd /home for user in `awk -F: '$3>999{print $1}' /etc/passwd`; do cp -r /usr/share/skel ./$user for dotfile in $user/dot.*; do mv $dotfile `echo $dotfile | sed 's#/dot\.#.#'` done chown -R $user:$user $user done Take a look at /usr/sbin/adduser to see how it does it > That will create home directories for all users whose UID > is greater than 999. > > Best regards > Oliver > > > -- > Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing > Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd > Any opinions expressed in this message may be personal to the author > and may not necessarily reflect the opinions of secnetix in any way. > > "C++ is the only current language making COBOL look good." > -- Bertrand Meyer > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers- > unsubscribe@freebsd.org" -- David King Computer Programmer Ketralnis Systems