From owner-freebsd-questions@FreeBSD.ORG Fri Jun 13 01:20:32 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEA4E106574F for ; Fri, 13 Jun 2008 01:20:31 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id 870208FC13 for ; Fri, 13 Jun 2008 01:20:31 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.2) with ESMTP id m5D1KTGn011884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 Jun 2008 20:20:29 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.2/Submit) id m5D1KTMj011867; Thu, 12 Jun 2008 20:20:29 -0500 (CDT) (envelope-from dan) Date: Thu, 12 Jun 2008 20:20:29 -0500 From: Dan Nelson To: Glenn Gillis Message-ID: <20080613012029.GA16341@dan.emsphone.com> References: <84a992f30806121702r39f132a8y11f8e410221e132c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84a992f30806121702r39f132a8y11f8e410221e132c@mail.gmail.com> X-OS: FreeBSD 7.0-STABLE User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-questions@freebsd.org Subject: Re: Tried to symlink /etc to another disk, now stuck X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2008 01:20:32 -0000 In the last episode (Jun 12), Glenn Gillis said: > I think I did just about the worst thing I could do to my > organization's FreeBSD-4.11 email server today: > > I was trying to free up space on the root disk and attempted to copy > the /etc directory to another disk, /new/etc, then delete and symlink > the old location to the new: > > $ sudo cp -Rp /etc /new/etc > $ sudo rm -rd /etc/; sudo ln -s /new/etc /etc > > Of course, with the sudoers file in the original /etc directory, the > first "sudo" command to remove the /etc directory disabled the second > "sudo" command's ability to run. > > Now, I cannot log in as a privileged user to copy or move /new/etc > back to /etc. (Because the password files were also in /etc.) I've > tried booting into Single User mode with "boot -s" at the boot > prompt, only to receive a "mountroot>" prompt wanting to know where > to find the root filesystem. I've also tried booting from my > installation distribution, but can't get out of the installation > without the machine rebooting. > > To make a long story shorter, is there any hope for getting a > privileged user account on this machine to move /etc back to where it > should be? It may be easiest to boot a live CD (FreeSBIE, or a FreeBSD-7 install disc 1 should work), mount both of your hard drives from it, and put /etc back where it belongs that way. -- Dan Nelson dnelson@allantgroup.com