hdiutil doesn't save all tags when creating a DMG archive

I'm using the Keka archiving application to create DMG archives of my work folders, as that seems to be the only archiving format that saves both creation and modification dates. However, only the first Tag is saved on each file. I'm told by the application author that he is using the hdiutil tool to create the archives. As Apple's native tool, I'm surprised that all the file/folder metadata isn't saved. Is this a bug, and if so, how would I report it to the relevant people at Apple?


(I'm running this on a 13 year old MacBook Pro that will only run OSX vs. 10.13.6 – is that pertinent?)


MacBook Pro 15″, macOS 10.13

Posted on Jul 11, 2025 04:47 AM

Reply
7 replies

Jul 11, 2025 09:50 PM in response to Peter Vince

I have not yet tested this macOS 10.13.6 but in macOS 15.5 Finder color label and color tags behave as follows.


In the example below I have added Finder color tags red, green, blue in that order:



In MacOS metadata they are stored as follows:


exiftool -a -G1 -s -MacOS:All image.jpg
[MacOS]         MDItemFSLabel                   : 4 (Blue)
[MacOS]         MDItemUserTags                  : Red, Green, Blue
[MacOS]         XAttrMDItemUserTags             : Red.6, Green.2, Blue.4


So the lastly added blue tag is used as a color label which, for example GraphicConverter displays in its Browser more readily while the color tags red, green, blue can be displayed via ctrl-clicking:



I created a .dmg from that folder with Disk Utility > File > New Image > Image from Folder... and at least there those labels and tags are preserved.



Jul 12, 2025 08:13 AM in response to Peter Vince

Peter Vince wrote:

"Disk Utility". However, I've just done so, and yes - it saves all the tags, but only the modification date, not the creation date

I now tried it in macOS Monterey 12.7.6 (...sorry, I am on a vacation using whatever Mac and macOS I can get hold on...) but there both labels, tags, file creation & modification date survive when Disk Utility > File > New Image > Image from Folder... saved as (APFS) .dmg. So please describe your workflow in detail.



FWIW AFAIR some file systems like in Linux do not support file creation date so that might not be very important. But occasionally I do want to know just when I created some ancient file so sometimes I copy that info from old backups to a new converted file.

Jul 11, 2025 02:13 PM in response to Peter Vince

Tags are a Finder-specific attribute.


Have you set custom tags in your Finder setup?

If so, I could imagine a situation where the data is copied (this file has tag #5 attached), but there's no guarantee that the destination host where the file is transferred to has the same definition for tag #5, so it's suppressed.

Not saying that is the case, just I can see how that might happen.


> Is this a bug, and if so, how would I report it to the relevant people at Apple?


Only Apple can say for sure if it's a bug, or working as designed. If it is a bug, the appropriate feed back is via https://feedback.apple.com/


As for MacOS 10.13, I don't think that's relevant, although I can almost guarantee that if someone from Apple does read this, decides it is a bug and fixes it, it certainly won't be back-ported to old OS versions, only to future releases.

Jul 13, 2025 06:06 AM in response to Matti Haveri

Thank you Matti. I did almost exactly how you described – ran up Disk Utility (vs. 17.0.3), and from the File menu: New Image > Image from folder. The archived folder doesn't retain its display format (List/Icons, icon size and positions etc.), so I put the folder I wanted to archive into a temporary enclosing folder, and archived that enclosing folder. The desired folder retained its "View Options", but the enclosed files had lost their creation dates.

Jul 13, 2025 06:58 AM in response to Peter Vince

Peter Vince wrote:

Disk Utility (vs. 17.0.3), and from the File menu: New Image > Image from folder. The archived folder doesn't retain its display format (List/Icons, icon size and positions etc.)

Yes, also in my setup Finder view options are not preserved. The very old Mac System 9 did that but I have given up trying to replicate that in OS X.


Maybe you could test if some backup utility like Carbon Copy Cloner would preserve file dates.


...


p.s. FWIW a few years ago (2021 to be exact) I wondered why after a CCC clone Finder did not always update the cloned color tags on the destination.


CCC support advised me to "Stop peeking at the destination :-)" with a longer explanation:


"CCC copies all of the information required to preserve these color tags, but the Finder does not always respect the data. It's the same deal for the Finder comments (tags are stored as a "com.apple.metadata:_kMDItemUserTags" extended attribute, comments are stored as a "com.apple.metadata:kMDItemFinderComment" extended attribute), and it comes down to the ancient way that Finder implements these file attributes. The problem doesn't just affect copies of files, you can actually lose these tags or comments just by renaming the files outside of the Finder. I filed a bug with Apple about this quite a while ago. They closed my bug as a duplicate, and the original report is still open.


That said, the actual result often depends on whether you "peek" at the destination. If you open the destination in the Finder prior to running your backup task, Finder will cache a bunch of those ".DS_Store" preference files. If you then run the backup task, and then revisit those folders on the destination, Finder will not only show you the cached versions of those files, but it will also replace those files with the cached versions. You should be able to do the following to get the Finder comments and tags preserved:


1. Restart your Mac (or log out and log back in)

2. Do not open the destination volume in the Finder

3. Run the backup task

4. At this point you should be able to view the content on the destination, and the comments and tags should be preserved"

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

hdiutil doesn't save all tags when creating a DMG archive

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.