From owner-freebsd-fs@FreeBSD.ORG Fri Jun 14 18:51:51 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E5B1B09; Fri, 14 Jun 2013 18:51:51 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [IPv6:2001:5a8:4:7e72:4a5b:39ff:fe12:452]) by mx1.freebsd.org (Postfix) with ESMTP id 2D809123E; Fri, 14 Jun 2013 18:51:51 +0000 (UTC) Received: from chez.mckusick.com (localhost [127.0.0.1]) by chez.mckusick.com (8.14.3/8.14.3) with ESMTP id r5EIpkl2054401; Fri, 14 Jun 2013 11:51:46 -0700 (PDT) (envelope-from mckusick@chez.mckusick.com) Message-Id: <201306141851.r5EIpkl2054401@chez.mckusick.com> To: Devin Teske , "Teske, Devin" Subject: Re: ZFS Union In-reply-to: <13CA24D6AB415D428143D44749F57D7201F81804@ltcfiswmsgmb21> Date: Fri, 14 Jun 2013 11:51:46 -0700 From: Kirk McKusick X-Spam-Status: No, score=0.0 required=5.0 tests=MISSING_MID, UNPARSEABLE_RELAY autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on chez.mckusick.com Cc: "freebsd-fs@freebsd.org" X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2013 18:51:51 -0000 The union filesystem uses "whiteout" to remove files that appear in a lower layer. In your example, when you `rm /vm/unit1/foo' what happens is that a whiteout entry gets created for /vm/unit1/foo. (Whiteout is implemented by creating a name with inode number 1; Inode 1 is the "anti-inode" which when combined with any other inode disappears in a cloud of greasy smoke.) Thus /vm/master/foo continues to exist and is visible as /vm/unit2/foo and /vm/unit3/foo. You can "recover" /vm/unit1/foo using `rm -W /vm/unit1/foo' which will remove the whiteout entry causing /vm/master/foo to once again be visible as /vm/unit1/foo. In short, I believe that the existing union filesystem will do what you want to do. Kirk McKusick