com.apple.mimic settings

All your general support questions for OpenZFS on OS X.

com.apple.mimic settings

Postby dmz » Tue Jul 26, 2022 6:16 pm

I'm curious about the com.apple.mimic settings, and what they're supposed to do. I know that there used to be com.apple.mimic_hfs, and it was replaced by com.apple.mimic, which can be hfs, apfs, or off - but is there a the difference between hfs and apfs? And if so, what is it? Regardless of which I choose, Finder reports that the volume is "Mac OS Extended" format...

I ask primarily because I've been having some panics on my new Mac Studio, and I'm fairly sure they're all due to ZFS (since they don't happen when I have no ZFS pools connected), but they often implicate other kernel modules in the backtrace, like smbfs or hfs. So I'm wondering whether the fact that I have some of my filesystems mimicing apfs (I have none mimicing hfs) is potentially to blame.
dmz
 
Posts: 22
Joined: Thu Mar 13, 2014 10:03 pm

Re: com.apple.mimic settings

Postby nathansvt » Sun Mar 17, 2024 7:01 pm

me too
nathansvt
 
Posts: 11
Joined: Mon Jan 19, 2015 10:25 am

Re: com.apple.mimic settings

Postby lundman » Mon Mar 18, 2024 2:41 pm

It has no effect on how things work. All it does is, when you query the filesystem, for example you can run "mount" command:

Code: Select all
/dev/disk3s1s1 on / (apfs, sealed, local, read-only, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk3s6 on /System/Volumes/VM (apfs, local, noexec, journaled, noatime, nobrowse)
/dev/disk3s2 on /System/Volumes/Preboot (apfs, local, journaled, nobrowse)
/dev/disk4s1 on /Volumes/zpool (zfs, local, noatime)


the mimic setting changes the string name type returned. Ie, in that list, "apfs" or "zfs". In this example, mimic is off, so "zpool" returns "zfs".

That is it.

Why is it needed? So many pieces of software of macOS will unfortunately query the filesystem, usually at Install time, or when you try to save
you data, and it does a string comparison with "hfs" or "apfs" - and if they don't match, pop up a message saying "not supported" or similar garbage.

This includes Apple's own software, which is especially frustrating. macOS has a nice way to ask if filesystems can do each feature from a large set of possible features, but instead they
do a string comparison with the type name.
User avatar
lundman
 
Posts: 1338
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: com.apple.mimic settings

Postby iosengineer » Mon May 06, 2024 8:48 pm

Bumping this thread for a closely-related question (this is one of the only results internet-wide!)

I've been using OpenZFS on OS X for a long time, and some snapshots I'd like to retain in my most important datasets still include the com.apple.mimic-hfs property.

It's great to see this generalized to com.apple.mimic, but after much research (and yes, asking some LLMs too ^_^), I cannot figure out how to zfs send / recv a snapshot that has com.apple.mimic-hfs set.

I'm willing to slosh tens of TB of data back and forth to make it happen if needed, so at the moment the only limitation is how I can actually achieve it, not the speed or space requirements. I've tried using the -x property on zfs recv, but for some reason that has no effect, and I still encounter the error.

Command:
Code: Select all
zfs send -RLev NVM/LowLatency@2-27-24 | zfs recv -s -F -o recordsize=128k -x com.apple.mimic_hfs -d Vault


Error:
Code: Select all
cannot receive com.apple.mimic_hfs property


In any case, my sincere thanks to @lundman for your heroic maintenance of this project. It has been a key part of my digital life, and I'm grateful to have access to it each day.
iosengineer
 
Posts: 2
Joined: Mon May 06, 2024 8:40 pm

Re: com.apple.mimic settings

Postby incumbent » Wed May 15, 2024 3:51 am

there's been some discussion recently about mimic= behavior being involved in kernel panics that imply APFS is the cause of kernel panics when mounting disk images. i have changed mine from apfs to hfs and have not been able to reproduce a panic yet, but it might be relevant to this thread.

the thread that inspired me to change my properties: viewtopic.php?f=24&t=3847
incumbent
 
Posts: 48
Joined: Mon Apr 25, 2016 8:52 am

Re: com.apple.mimic settings

Postby abc123 » Thu May 16, 2024 1:03 am

incumbent wrote:there's been some discussion recently about mimic= behavior being involved in kernel panics that imply APFS is the cause of kernel panics when mounting disk images. i have changed mine from apfs to hfs and have not been able to reproduce a panic yet, but it might be relevant to this thread.

the thread that inspired me to change my properties: viewtopic.php?f=24&t=3847


I've now changed my mimic setting from APFS to HFS and the kernel panics I'd see when unmounting a disk image seem to have gone also. Most notably would occur for me when installing the iOS simulator package each time Xcode is updated. I used to have to download manually all the time and install with the zpool exported.
abc123
 
Posts: 64
Joined: Mon Jan 30, 2017 11:46 pm

Re: com.apple.mimic settings

Postby incumbent » Thu May 16, 2024 3:46 am

oh my g-d of course! with all my brew updgrade tasks and xcode updates i will see if i have any telemetry on those via syslog server but macOS unified log forwarding is not something i have 100% visibility on but when you mentioned xcode i can't tell you the times i have had guest stars in `df` from those updates.

if i can find anything that made it out before i wiped that workstation a month ago, i thought the internal ssd was failing!
incumbent
 
Posts: 48
Joined: Mon Apr 25, 2016 8:52 am

Re: com.apple.mimic settings

Postby iosengineer » Wed Jun 05, 2024 12:40 pm

incumbent wrote:there's been some discussion recently about mimic= behavior being involved in kernel panics that imply APFS is the cause of kernel panics when mounting disk images. i have changed mine from apfs to hfs and have not been able to reproduce a panic yet, but it might be relevant to this thread.

the thread that inspired me to change my properties: viewtopic.php?f=24&t=3847


Thank you, this is really valuable information. I have indeed encountered those disk image panics referring to APFS and assumed it was an OS bug!

I would *greatly* appreciate if anyone has advice on how to cleanse old snapshots of the mimic property. I am quite stuck on how to address this with my datasets. At this point I'm even considering if I have to rebuild each snapshot into a new dataset by rsync'ing files out of the snapshot, which seems like it should not be necessary and is very error-prone.
iosengineer
 
Posts: 2
Joined: Mon May 06, 2024 8:40 pm


Return to General Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron