[TriLUG] Moving a subdirectory tree

Mike Broome mbroome at employees.org
Sun Feb 3 09:38:17 EST 2002


"cp -a" worked for me recently.  (-a is shorthand for -dpR.  It's the -p
that preserves the timestamps.)

Mike

On Sun, Feb 03, 2002 at 10:21:16AM +0500, Tom Bryan wrote:
> I have lots of partitions (don't ask me why...it's too big of a pain to 
> change it now) on my home Linux machine.  With the growing size of an 
> "Everything" Red Hat install, my /usr partition has filled up.  I plan to 
> move /usr/share to another partition and remount it at /usr/share.  I've made 
> the new filesystem with some spare disk space that I had.  Now I have a 
> problem.  How to move the files.  Ideally, I'd keep the RPM database happy 
> (not complaining about file permissions and dates).  I mounted the new 
> filesystem to /mnt and ran
> 
> cd /mnt;  tar cf - -C /usr/share . | tar xpf - 2> tar.stderr
> 
> but that doesn't preserve timestamps.  Is there a better way to move files 
> from one partition to another?
> 
> Thanks,
> ---Tom

-- 
Mike Broome
mbroome(at)employees.org



More information about the TriLUG mailing list