6

I read @SwisherSweet's question of the fastest and safest way to copy massive data from one external drive to another, along with @GrahamMiln's excellent answer.

I'm in a similar situation where I want to copy data from a Firewire 800 connected external hd to Drobo 5N, which is connected to the router that the iMac is connected to:
ExternalHd — iMac — Router — Drobo5N

I executed the command (sudo rsync -vaE --progress /Volumes/SourceName /Volumes/DestinationName) and it works for some part, but on occasion I get the following error (I inserted some line breaks for better readability):

Boxx:~ Alex$ sudo rsync -vaE --progress /Volumes/ExternalHd/path/to/MyDirectory /Volumes/Drobo5N/path/to/

building file list ... 
6 files to consider

._MyDirectory
        1104 100%    0.00kB/s    0:00:00 (xfer#1, to-check=5/6)

MyDirectory/._file1.dmg
        1430 100%   34.06kB/s    0:00:00 (xfer#2, to-check=3/6)

MyDirectory/._file2.dmg
        1430 100%   27.38kB/s    0:00:00 (xfer#3, to-check=2/6)

copyfile(.._MyDirectory.drJHX3,./MyDirectory, COPYFILE_UNPACK) failed:45
copyfile(MyDirectory/.._file1.dmg.PQTcsU,MyDirectory/file1.dmg, COPYFILE_UNPACK) failed:45
rsync: rename "/Volumes/Drobo5N/path/to/MyDirectory/.._file1.dmg.PQTcsU" -> "MyDirectory/._file1.dmg": No such file or directory (2)
copyfile(MyDirectory/.._file2.dmg.gx7VTP,MyDirectory/file2.dmg, COPYFILE_UNPACK) failed:45
rsync: rename "/Volumes/Drobo5N/path/to/MyDirectory/.._file2.dmg.gx7VTP" -> "MyDirectory/._file2.dmg": No such file or directory (2)

sent 4369 bytes  received 86 bytes  8910.00 bytes/sec
total size is 48176733  speedup is 10814.08

rsync error: some files could not be transferred (code 23) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/main.c(992) [sender=2.6.9]

Some questions:

  1. Why do I get these copyfile(...) failed:45 errors?
    I found the source code for copyfile.c, but could not find out what triggers the error. In there it says about COPYFILE_UNPACK:

    COPYFILE_UNPACK is the undoing of COPYFILE_PACK, obviously. The goal there is to take an Apple Double file, and turn it into a normal file (with data fork, resource fork, modes, extended attributes, ACLs, etc.).

    My error message says something about COPYFILE_UNPACK, but what does it mean and how can I fix the error?

  2. Why does the rsync command create the dot file like ._file1.dmg?
    When rsync completes successfully I still see the dot file in the synced destination directory (/Volumes/Drobo5N/path/to/) in addition to the actual synced file. Why is that?
  3. Why does rsync create extensions like .drJHX3? Is that a temp name?

P.S.: Sorry if this has been asked elsewhere. I've search for this error using rsync, but couldn't surface any.

6
  • Apple's rsync is old so I would find a more uptodate one especially with metadata issues. Also what format are the drives
    – mmmmmm
    Commented May 19, 2016 at 19:37
  • Are you saying the copyfile errors are due to metadata issues?With "format" do you mean file system? I will need to look the up when I'm back at my desk… Should I be surprised if the file system is HFS+ because the resource-/metadata-fork is stored as a separate file? Commented May 19, 2016 at 22:55
  • @Mark Would you recommend updating via MacPorts Commented May 20, 2016 at 5:56
  • @graham-miln Since you gave the winning answer for the question that triggered my question here, I was wondering if you have some input, if you like. Commented May 20, 2016 at 6:11
  • Error 45 is defined in /usr/include/sys/errno.h- #define ENOTSUP 45 /* Operation not supported */
    – fd0
    Commented May 20, 2016 at 15:44

2 Answers 2

4

I was using the -E option to copy alias files on macOS (as without -E option alias files copy as executable files). The -E Options worked for copying the Alias files, but caused the same error as here on other files (COPYFILE_UNPACK failed:45). Therefore appears error is probably caused by using -E option in macOS.

Fortunately using Homebrew and running brew install rsync to install a more recent version of rsync fixed the problem.

Source: https://bayton.org/2018/07/how-to-update-rsync-on-mac-os-high-sierra/

2

Copyfile is responsible for splitting a HFS+ file into two files. The data fork- file and a metadata fork- ._file. That happens when you use the -E option with the Apple supplied rsync. I have no idea why it is failing. rsync does create temporary files and then moves them into place.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .