Restore sparsebundle extended attributes after rsync

If you rsync a sparse bundle to another Mac without the -E flag (or if you copy it to a non Mac system), you will loose the ability to double click on it in the Finder to mount it. This is because the extended attributes telling the Finder the folder is actually a bundle are lost in the transfer.

The following piece of code I found here fixed the problem for me. Simply compile and run the code giving the path to the bundle in parameter and it will restore the attributes.

1 thought on “Restore sparsebundle extended attributes after rsync

  1. Josh Enders

    rsync -E is executability:

    $ rsync –help | grep — -E
    -E, –executability preserve the file’s executability

    I think you mean -X:

    $ rsync –help | grep — extended
    -X, –xattrs preserve extended attributes

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.