From owner-freebsd-questions Wed May 29 19:46: 2 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id D0C4437B408 for ; Wed, 29 May 2002 19:45:53 -0700 (PDT) Received: (from dan@localhost) by dan.emsphone.com (8.12.2/8.12.3) id g4U2jreh062039; Wed, 29 May 2002 21:45:53 -0500 (CDT) (envelope-from dan) Date: Wed, 29 May 2002 21:45:53 -0500 From: Dan Nelson To: Peter Leftwich Cc: Matthias Buelow , FreeBSD LIST Subject: Re: mv vs. tar [overlapping] Message-ID: <20020530024553.GC78068@dan.emsphone.com> References: <20020530022609.GA956@altair.mukappabeta.net> <20020529223005.O79882-100000@earl-grey.cloud9.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020529223005.O79882-100000@earl-grey.cloud9.net> User-Agent: Mutt/1.3.99i X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (May 29), Peter Leftwich said: > On Thu, 30 May 2002, Matthias Buelow wrote: > > Dan Nelson writes: > > > A tar pipe will be much faster, since reading and writing will be overlapped. > > > ( cd /source ; tar cf - . ) | ( cd destination ; tar xfp - ) > > eh? sorry but I think that's nonsense. --mkb > > Actually, it's an interesting point... I think what Dan means is that read > and write processes run concurrently (have you ever run multiple HTTP > requests at once? it's a lot like that I suppose). So it would seem > tarring is quickest when moving a directory within the same filesystem! Even to different filesystems. A single process can only be reading or writing, and when it's blocked reading, it can't be writing. If you are copying files over a couple meg, it also helps to increase the buffering between the two tars by putting team (from ports) inbetween them, and raising tar's blocksize: ( cd /source ; tar cbf 128 - . ) | team 1m 4 | ( cd /destination ; tar xbpf 128 - ) If you're talking about /moving/ within the /same/ filesystem, nothing will beat "mv", since all it does is rename the files to the new location. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message