From owner-freebsd-questions@FreeBSD.ORG Wed Oct 6 09:23:26 2004 Return-Path: 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 E17E116A4D0 for ; Wed, 6 Oct 2004 09:23:26 +0000 (GMT) Received: from mail.elvandar.org (redqueen.elvandar.org [217.148.169.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B1A543D48 for ; Wed, 6 Oct 2004 09:23:26 +0000 (GMT) (envelope-from remko@elvandar.org) Received: from localhost (localhost [127.0.0.1]) by mail.elvandar.org (Postfix) with ESMTP id B2C4B29544F; Wed, 6 Oct 2004 11:23:24 +0200 (CEST) Received: from mail.elvandar.org ([127.0.0.1]) by localhost (redqueen.elvandar.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 78942-13; Wed, 6 Oct 2004 11:23:23 +0200 (CEST) Message-ID: <4163B98F.1050409@elvandar.org> Date: Wed, 06 Oct 2004 11:23:27 +0200 From: Remko Lodder User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brian References: <200410060735.i967ZGXL009001@emboss.bossbox.com> In-Reply-To: <200410060735.i967ZGXL009001@emboss.bossbox.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at elvandar.org cc: freebsd-questions@freebsd.org Subject: Re: Cp -Rp Nightmare unable to access /usr X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 09:23:27 -0000 Brian wrote: > Hi, > > I'm running a FreeBSD 5.2.1 test box at home for Apache,PHP,MySQL. > > I wanted to move the default mysql dabatse location from /var/db/mysql to > /usr/mysql > > What I did was cp -Rp /var/db/mysql /usr > > I know now it was wrong for the most part I know how stupid this idea was. > > I now can't ssh to the box I get the error below > > Could not chdir to home directory /home/reports: Permission denied > /usr/local/bin/bash: Permission denied /home lives in /usr/home so it is able that you overwrote permissions for that, strangely enough you aren't even allowed to access bash, so it seems to me that more happened then just a recursive copy of /var/db/mysql to /usr... you should chown them back to the original user (if you can still login as root preferable at the console, ls -lart and check the permissions on the directories...) and next time consider something like: cp -pr /var/db/mysql /usr (so that the entire directory gets copied instead of recursive access all dirs and copy them with file information preservation (permissions,timestamp etc) into /usr If you are not able to do that, then it seems that it really got messed up, what you can do then is use a freesbie cd (live cd) to boot the system, access the data on it and backup the data. Then a reinstall would cause everything to return to normal. This is how i would do it, any better suggestions are of course welcome! :-) Cheers! > > What I'm looking to know is, what exactly have I done to /usr and if I'm at > the console can I easiliy reverse what I did ? > > Thanks in advance. > > Brian > -- Kind regards, Remko Lodder |remko@elvandar.org Reporter DSINet |remko@dsinet.org Projectleader Mostly-Harmless |remko@mostly-harmless.nl Founder Tienervaders |remko@tienervaders.org