From owner-freebsd-fs@FreeBSD.ORG Fri Apr 21 05:25:50 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0006116A403 for ; Fri, 21 Apr 2006 05:25:49 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from pittgoth.com (ns1.pittgoth.com [216.38.206.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FCCB43D45 for ; Fri, 21 Apr 2006 05:25:47 +0000 (GMT) (envelope-from trhodes@FreeBSD.org) Received: from localhost (net-ix.gw.ai.net [205.134.160.6] (may be forged)) (authenticated bits=0) by pittgoth.com (8.13.4/8.13.4) with ESMTP id k3L6Tmst097388 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 21 Apr 2006 02:29:49 -0400 (EDT) (envelope-from trhodes@FreeBSD.org) Date: Fri, 21 Apr 2006 01:25:37 -0400 From: Tom Rhodes To: Kris Kennaway Message-Id: <20060421012537.0949ac45.trhodes@FreeBSD.org> In-Reply-To: <20060414064727.GA77608@xor.obsecurity.org> References: <1144687418.11014.9.camel@diegows> <443AFB03.6060301@samsco.org> <20060411210858.G46778@delplex.bde.org> <20060413041618.6aa7d8c7.trhodes@FreeBSD.org> <20060414064727.GA77608@xor.obsecurity.org> X-Mailer: Sylpheed version 1.0.5 (GTK+ 1.2.10; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-fs@FreeBSD.org Subject: Re: How a file is deleted in ufs2? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2006 05:25:50 -0000 On Fri, 14 Apr 2006 02:47:27 -0400 Kris Kennaway wrote: > On Thu, Apr 13, 2006 at 04:16:18AM -0400, Tom Rhodes wrote: > > On Tue, 11 Apr 2006 22:56:11 +1000 (EST) > > Bruce Evans wrote: > > > > > On Mon, 10 Apr 2006, Scott Long wrote: > > > > > > > IOW, there is no easy way to undelete a file. > > > > > > This is currently true, except in the rare case where undelete(2) works. > > > > Oh, so it has worked for someone. I always wonder why we have this > > functionality when I have never been able to make it work. Using > > rm(1) that is. > > DESCRIPTION > The undelete() system call attempts to recover the deleted file named by > path. Currently, this works only when the named object is a whiteout in > a union file system. What it fails to do is tell users what a "whiteout" is. At least it was very unobvious to me while reading the manual page. -- Tom Rhodes From owner-freebsd-fs@FreeBSD.ORG Fri Apr 21 10:26:24 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.ORG Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60B5016A401 for ; Fri, 21 Apr 2006 10:26:24 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 987D343D46 for ; Fri, 21 Apr 2006 10:26:23 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (hobmtu@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k3LAQHEa096363 for ; Fri, 21 Apr 2006 12:26:22 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k3LAQH5S096362; Fri, 21 Apr 2006 12:26:17 +0200 (CEST) (envelope-from olli) Date: Fri, 21 Apr 2006 12:26:17 +0200 (CEST) Message-Id: <200604211026.k3LAQH5S096362@lurza.secnetix.de> From: Oliver Fromme To: freebsd-fs@FreeBSD.ORG In-Reply-To: <20060421012537.0949ac45.trhodes@FreeBSD.org> X-Newsgroups: list.freebsd-fs User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 21 Apr 2006 12:26:22 +0200 (CEST) Cc: Subject: Re: How a file is deleted in ufs2? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-fs@FreeBSD.ORG List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2006 10:26:24 -0000 Tom Rhodes wrote: > Kris Kennaway wrote: > > Tom Rhodes wrote: > > > Bruce Evans wrote: > > > > On Mon, 10 Apr 2006, Scott Long wrote: > > > > > > > > > IOW, there is no easy way to undelete a file. > > > > > > > > This is currently true, except in the rare case where undelete(2) works. > > > > > > Oh, so it has worked for someone. I always wonder why we have this > > > functionality when I have never been able to make it work. Using > > > rm(1) that is. > > > > DESCRIPTION > > The undelete() system call attempts to recover the deleted file named by > > path. Currently, this works only when the named object is a whiteout in > > a union file system. > > What it fails to do is tell users what a "whiteout" is. At least > it was very unobvious to me while reading the manual page. It should be obvious after reading the undelete(2) manpage and the mount_unionfs(8) manpage (to which the former refers). Whiteouts are needed for UNIONFS mounts because the lower layer of such a mount is read-only, so you cannot remove files from it. When you delete a file on a UNIONFS that exists in the lower layer, a so-called whiteout is written to the upper layer which causes the file in the lower layer to become invisible and inaccessible (I think "ls -W" can be used to see the whiteout itself). In other words, such an unlink operation does not really physically delete the file. The undelete(2) function removes the whiteout, so the file becomes visible and accessible again. See "rm -W". 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. "In My Egoistical Opinion, most people's C programs should be indented six feet downward and covered with dirt." -- Blair P. Houghton From owner-freebsd-fs@FreeBSD.ORG Fri Apr 21 18:14:41 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADC8616A400; Fri, 21 Apr 2006 18:14:41 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 648AE43D45; Fri, 21 Apr 2006 18:14:41 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 481921A4D89; Fri, 21 Apr 2006 11:14:41 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id E711055238; Fri, 21 Apr 2006 14:14:13 -0400 (EDT) Date: Fri, 21 Apr 2006 14:14:13 -0400 From: Kris Kennaway To: Tom Rhodes Message-ID: <20060421181413.GA68087@xor.obsecurity.org> References: <1144687418.11014.9.camel@diegows> <443AFB03.6060301@samsco.org> <20060411210858.G46778@delplex.bde.org> <20060413041618.6aa7d8c7.trhodes@FreeBSD.org> <20060414064727.GA77608@xor.obsecurity.org> <20060421012537.0949ac45.trhodes@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: <20060421012537.0949ac45.trhodes@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-fs@FreeBSD.org, Kris Kennaway Subject: Re: How a file is deleted in ufs2? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2006 18:14:41 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 21, 2006 at 01:25:37AM -0400, Tom Rhodes wrote: > On Fri, 14 Apr 2006 02:47:27 -0400 > Kris Kennaway wrote: >=20 > > On Thu, Apr 13, 2006 at 04:16:18AM -0400, Tom Rhodes wrote: > > > On Tue, 11 Apr 2006 22:56:11 +1000 (EST) > > > Bruce Evans wrote: > > >=20 > > > > On Mon, 10 Apr 2006, Scott Long wrote: > > > >=20 > > > > > IOW, there is no easy way to undelete a file. > > > >=20 > > > > This is currently true, except in the rare case where undelete(2) w= orks. > > >=20 > > > Oh, so it has worked for someone. I always wonder why we have this > > > functionality when I have never been able to make it work. Using > > > rm(1) that is. > >=20 > > DESCRIPTION > > The undelete() system call attempts to recover the deleted file na= med by > > path. Currently, this works only when the named object is a white= out in > > a union file system.=20 >=20 > What it fails to do is tell users what a "whiteout" is. At least > it was very unobvious to me while reading the manual page. But it's still quite clear that it still only applies to union filesystems, even if you have to dig deeper to find out how it works in that case. Kris --/04w6evG8XlLl3ft Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFESSD0Wry0BWjoQKURAjQgAKDhF+jVKz7Zd41HebFl8iwXxVwOlwCfZFj4 Vt7Vja+jdqaKviVSRWlsqPc= =uwxd -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft--