*BSD News Article 45764


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yarrina.connect.com.au!warrane.connect.com.au!godzilla.zeta.org.au!not-for-mail
From: bde@zeta.org.au (Bruce Evans)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Moving directories across filesystems
Date: 18 Jun 1995 17:28:40 +1000
Organization: Kralizec Dialup Unix Sydney - +61-2-837-1183, v.32bis v.42bis
Lines: 29
Message-ID: <3s0kj8$ia6@godzilla.zeta.org.au>
References: <3r7c0h$qn1@news.bu.edu> <3rhvhr$r2h@si-nic.hrz.uni-siegen.de>
NNTP-Posting-Host: godzilla.zeta.org.au

In article <3rhvhr$r2h@si-nic.hrz.uni-siegen.de>,
Peter Merz <peter@netz.hrz.uni-siegen.de> wrote:
>Mikhail Teterin (mi@cs.bu.edu) wrote:
>: I tried to :
>: 	mv /root /usr/home/root
>: And it failed (/usr was mounted on another partition). Is this a correct 
>: behavior now? Files are moved just fine 

It is supposed to work.  I tried

	cd /
	cp -pR root z
	mv z ~

and everything was moved OK except the modification and access times of the
directory were not preserved.  mv across file systems is implemented as
essentially `cp -pR' followed by `rm -r' of the source, so mv across file
systems inherits many bugs from `cp -pR': directory times of nonempty
directories are not preserved, and hard links are snapped.

>That's the right behaviour. You cannot move dircetories across filesystems.

Nope.  You cannot rename either directories or files across file systems.
mv is different from rename, and is supposed to handle directories in the
same way as files, by creating them and copying their contents.  You often
don't want this behaviour.  Copying whole file systems is very slow and
not atomic.
-- 
Bruce Evans  bde@zeta.org.au