From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 26 11:58:50 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 CE20116A407 for ; Tue, 26 Sep 2006 11:58:50 +0000 (UTC) (envelope-from tech@nano.net) Received: from mail.smallweb.com (mail.smallweb.com [216.85.125.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60AAC43D76 for ; Tue, 26 Sep 2006 11:58:45 +0000 (GMT) (envelope-from tech@nano.net) Received: from Sixpence.mail.smallweb.com (sixpence.nano.net [216.85.125.9]) by mail.smallweb.com (Rockliffe SMTPRA 5.3.11) with ESMTP id for ; Tue, 26 Sep 2006 06:06:42 -0600 Message-Id: <6.2.0.14.2.20060926055737.0302bd00@nano.net> X-Mailer: QUALCOMM Windows Eudora Version 6.2.0.14 Date: Tue, 26 Sep 2006 05:58:43 -0600 To: freebsd-hackers@FreeBSD.ORG From: tech@nano.net In-Reply-To: <200609261121.k8QBLRSP041907@lurza.secnetix.de> References: <6.2.0.14.2.20060925123108.03038af0@nano.net> <200609261121.k8QBLRSP041907@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: 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: Tue, 26 Sep 2006 11:58:50 -0000 Thanks! And thanks for the sh recommendation, that easier than what I was going to do... At 05:21 AM 9/26/2006, you wrote: >tech@nano.net wrote: > > I've got a /usr partition with some problems. During boot it fails and > I'm > > prompted to run fsck manually. I do so and when fsck has finished it asks > > me to run it again, and again, and again... > >If that happens, I would assume that the disk is dying. Do >not try to fsck it, because it will probably make it worse. >Instead, use "dd if=/dev... of=... conv=noerror,sync" to copy >the disk to a safe place (i.e. other disk of same size or >larger). Then run fsck there. > > > 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 > >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