I have an NTFS volume that I am copying into a new HFS+ volume. I'm using the following command to copy everything including all hidden directories and attributes:
sudo rsync -aAXvF --del --chmod=F-x,go-w /Volumes/NTFS/ /Volumes/HFS
The F-x,go-w
is there to fix the permissions from NTFS (which has simply rwxrwxrwx
on everything). -a
(archive), -A
(ACLs), and -X
(xattrs) force rsync
to copy as much file metadata as possible.
However, one quirk of this copy is that Windows hidden files (e.g. $RECYCLE.BIN
, System Volume Information
, etc.) still show up as visible in HFS+. Is there a flag I could pass to rsync
or a similar command that could preserve this metadata bit?
Best Answer
I don't have a ntfs partition to test it, but my
man rsync
documents the-E
switch:I don't know if that helps, but it's worth a try.
Another thing to try would be to use the
ntfs-3g
driver to mount the partition, which includes thehide_hid_files
option:I assume
ntfs-3g
translates ntfs' hidden attribute before presenting the file to the system.rsync
might then be able to preserve it.ntfs-3g
can be installed via Homebrew.If that fails, too, you will likely have to hide the files yourself. To do so you may use either
chflags hidden <file>
or prepend the file with a.
. Both will hide the files in Finder. If you use the terminal frequently, you may prefer prepending the.
, as it also hides the files from regularls
output (without the-a
switch)