From owner-freebsd-questions@FreeBSD.ORG Tue Dec 2 01:48:51 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 E546A1065670 for ; Tue, 2 Dec 2008 01:48:51 +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 B2A8A8FC19 for ; Tue, 2 Dec 2008 01:48:51 +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.3) with ESMTP id mB21mod1017901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 1 Dec 2008 19:48:51 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.3/Submit) id mB21mnqT017900; Mon, 1 Dec 2008 19:48:49 -0600 (CST) (envelope-from dan) Date: Mon, 1 Dec 2008 19:48:49 -0600 From: Dan Nelson To: Reinis Ivanovs Message-ID: <20081202014849.GA22076@dan.emsphone.com> References: <5b826e210812011636l71dc6d05n25a14acdd24b396d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5b826e210812011636l71dc6d05n25a14acdd24b396d@mail.gmail.com> X-OS: FreeBSD 7.1-PRERELEASE User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-questions@freebsd.org Subject: Re: Reversing a ZFS mistake 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: Tue, 02 Dec 2008 01:48:52 -0000 In the last episode (Dec 02), Reinis Ivanovs said: > It seems I've made a mistake using ZFS, and now my /usr/local/ is > empty. I wanted to create a snapshot of a directory inside of it, so > I ran "zfs create tank/usr/local" and "zfs create tank/usr/local/www" > as I had seen in the guides I'd been using. That worked, but the > filesystems created were empty. As I found out later, doing what I > did on Solaris would have created the filesystems but not mounted > them, but on FreeBSD they were mounted automatically, and the > previous contents hidden. The question now is, how do I get my files > back? The system is crippled without /usr/local/ and I can't unmount > or destroy it, because it says that the device is busy. Any help > would be appreciated. Solaris should have automatically mounted them too, unless you had "zfs set" canmount=noauto or mountpoint=legacy on an upper filesystem. If you intend to copy/move the existing contents into these new filesystems, you can just umount them and manually mount them somewhere else ( mount -t zfs tank/usr/local /tmp/local ) while you do the copy, then remount them in their final locations. umount -f should let you force-dismount them even if processes have open filehandles on them. If it doesn't, run "fstat -f /usr/local" and kill any processes that show up, then try umounting again. -- Dan Nelson dnelson@allantgroup.com