Copying file systems.

From: <mortimer_at_physics.uq.oz.au>
Date: Tue, 25 Jun 96 09:25:13 +1000

Hi

I recently had to copy a complete file system from one disk
to another. Naively I first tried `cp -pR`. As you probably
realize this didn't work. Specifically, in order of increasing
seriousness:

   o Directories had their modification times set to the
      time of copying rather than the same time as the source.

   o Files with the sticky bit set on the source did not have
      the sticky bit set on the destination.

   o Symbolic links were recreated as promised by the -R option
      but they had the wrong owner:group set. All recreated
      symbolic links had root:system as owner:group.

With the help of the archives for this mailing list I discovered
that the correct way to copy a complete file system was with dump
and restore. Specifically

        dump -0f - file_system | (cd /mnt; restore -vrf -)

does what I wanted.

My problem is that I sometimes need to move a user's area from
one disk to another. Since this is only part of a file system
I can't use dump and restore although I suppose I could use tar
in a similar way.

Why doesn't `cp -pR` work the way I expected. Is this a bug with
cp (we are running OSF1 v3.2 214) or is it supposed to work this way.


Ian Mortimer
Department of Physics Tel : +61 7 3365 3416
University of Queensland Email: mortimer_at_physics.uq.edu.au
St. Lucia, Brisbane Fax : +61 7 3365 1242
Queensland, Australia. 4072.

Disclaimer: Any opinions expressed are my own and do not represent those
            of the University of Queensland or the Department of Physics.
Received on Tue Jun 25 1996 - 01:35:33 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT