From owner-freebsd-questions Thu May 30 8: 0:21 2002 Delivered-To: freebsd-questions@freebsd.org Received: from gromit.dlib.vt.edu (gromit.dlib.vt.edu [128.173.49.29]) by hub.freebsd.org (Postfix) with ESMTP id 86BB637B406 for ; Thu, 30 May 2002 08:00:06 -0700 (PDT) Received: from gromit.dlib.vt.edu (localhost.dlib.vt.edu [127.0.0.1]) by gromit.dlib.vt.edu (8.12.3/8.12.2) with ESMTP id g4UExxbn010899 for ; Thu, 30 May 2002 10:59:59 -0400 (EDT) (envelope-from paul@gromit.dlib.vt.edu) Received: (from paul@localhost) by gromit.dlib.vt.edu (8.12.3/8.12.3/Submit) id g4UExwCc010898 for questions@FreeBSD.ORG; Thu, 30 May 2002 10:59:58 -0400 (EDT) Date: Thu, 30 May 2002 10:59:58 -0400 From: Paul Mather To: questions@FreeBSD.ORG Subject: Re: mv vs. tar [overlapping] Message-ID: <20020530145958.GA10665@gromit.dlib.vt.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.99i X-No-Archive: yes X-Operating-System: FreeBSD/i386 4.5-STABLE 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 On Wed, 29 May 2002 23:19:00 -0400 (EDT) Jason Hunt wrote: => When 'mv'ing files between locations on the same physical disk, then => the only filesystem operation that is being performed is to update the => directory tree. An exception to this is when using 'mv' between different => physical disks or over NFS mount points, in which case the method for 'cp' => ends up being performed. => => Basically, 'mv' will be much faster in most scenarios. Refer to my other => e-mail from about an hour ago for when you might not want to use 'mv'. => => Once again, I am no expert. I'm probably wrong on a few points and/or => overlooked some things. I havn't gotten that far yet in reading "The => Design and Implementation of the 4.4BSD Operating System", which => is an excellent book if you want to learn what goes on behind the scenes. => :) It's a great book. The source code for FreeBSD is rather informative in these instances, too. A perusal of /usr/src/bin/mv/mv.c yields the fact that rename(2) is used to mv within filesystems; "cp and rm" is used for mv across devices and filesystems---just as you say. Cheers, Paul. e-mail: paul@gromit.dlib.vt.edu "Without music to decorate it, time is just a bunch of boring production deadlines or dates by which bills must be paid." --- Frank Vincent Zappa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message