6

I recently had to (hurriedly) back up data on an older Macbook before migrating it to a new one. Since all I had at my disposal was a large FAT32 formatted drive, I used that and a manual copy. I've since used rsync to put it back on a (non-journaled) HFS+ drive (under Ubuntu).

Now most of the files have a corresponding ._ file alongside them. I understand that this is how OS X stores extended attributes and other information on non-HFS+ filesystems. So my question is: now that I have these files back on a HFS+ filesystem, how can I reconcile the information in the ._ files? That is, since the data in those files can now be stored in the HFS+ metadata for each file, how do I put it back?

2

You can copy the files using Finder. It seems Finder can reconcile these when copying from a partition type that doesn't support extended metadata to a partition type that does, reversing it's procedure for doing the reverse and creating the dotfiles.

  • Seems reasonable. I'll try it out soon. – detly Jul 22 '14 at 9:33
  • "… from a partition type that doesn't support extended metadata …"; the ._ files are already on HFS Plus. – Graham Perrin Jul 22 '14 at 20:51
  • @Graham Yes, but copied with rsync which doesn't merge the dotfiles. I meant copying them from the original FAT32 partition to the HFS+ with Finder. – grg Jul 22 '14 at 20:53
  • Not only Finder. Utilities such as ditto(1) will preserve resource forks, HFS metadata, extended attributes and ACLs. – Graham Perrin Jul 22 '14 at 21:00
8

dot_clean

dot_clean(1) Mac OS X Manual Page

Apple's description:

For each dir, dot_clean recursively merges all ._* files with their corresponding native files according to the rules specified with the given arguments. By default, if there is an attribute on the native file that is also present in the ._ file, the most recent attribute will be used.

If no operands are given, a usage message is output. If more than one directory is given, directories are merged in the order in which they are specified.

Proceed with caution. Whilst the man page lists no known bugs, it is possible to lose data through careless use of the command.

  • I've always thought dot_clean simply cleaned the dotfiles rather than merging them; this is the way to go, +1 – grg Jul 22 '14 at 20:49
  • When I last checked, long ago, there was no file system capability check. So, for example, applying a dot_clean command to any part of an MS-DOS FAT32 volume would silently lose (be unable to merge) the content of ._ files in that part of the volume. Square peg, round hole ;) – Graham Perrin Jul 22 '14 at 21:25

You must log in to answer this question.

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