# MacOS – Using Rsync For Exact Copy

command linefilesystemmacosrsync

I've used rsync before, on Linux, many times, but also many years ago and I also don't know if there are any differences or issues between using it on an iMac and on Linux.

I have a drive with a problem and now mounts read-only. I replaced it with a good new drive and it's now connected via USB in a SATA case.

If I want to create a folder on the new drive, say, "/OldDrive", and copy all the files on my old drive over to it, preserving ownerships, permissions, and anything else macOS cares about, what are the command options and switches I need to use on rsync to do this?

I'd use ditto or asr if you need a command line solution. Disk Utility calls asr internally and you could mirror the volume and then wipe and run Migration Assistant - that's far better than trying to boot from a damaged copy.
That saves a step and you don't even need to worry about syntax of asr or ditto or rsync