Page 1 of 1

auto mount on boot - 2.2.2 - Monterey

PostPosted: Fri May 24, 2024 12:40 pm
by z-fan88
Hello:

After a long time away, I'm trying OpenZFS on MacOS again (I run ZFS on my Promox machine and other places).

The set up on an Intel 2013 Mac Pro, Montery (a fresh install of 12.7.5), went pretty well. A few strange things. I'll skip a few, but one was when creating a raidz-1 of four SSDs, disks defined like: /var/run/disk/by-serial/Samsung_SSD_860_EVO_500GB-<redactedSN>

It worked, but threw errors: cannot open '/private/var/run/disk/by-serial/Samsung_SSD_860_EVO_500GB-<redactedSN>': Operation not permitted (for all four drives).

Perhaps I can ignore that, since it created fine.

But it won't auto-mount on reboot. I have the pool mounted, reboot, and when the machine comes back Disk Utility offers to format each of the four drives for me (no thanks!) and the pool does not mount. The pool will mount if I just type sudo zpool import -a ... and if I search with sudo zpool import, it does name the pool as available for import.

In "Security and Privacy" under Full Disk Access I have the following listed and checked: sshd-keygen-wrapper, zpool, smbd, Terminal.

Thanks.

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Fri May 24, 2024 12:42 pm
by cgiard
You'll need to add bash to the list of what allowed for full disk access. That's one of the reasons I don't have auto mounting setup on my system, because allowing bash to have full disk access means any script someone gets onto the system can do just about anything to it. It would be much better if instead of scripts to do the auto mounting it was compiled binaries.

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Fri May 24, 2024 12:48 pm
by z-fan88
Thanks cgiard. Is there a work-around to have the OS just ignore the disk instead of throwing up the offer to format the zfs member disks?

... it seems like one should be able to use Automator to make a script that can be compiled and that one thing could be allowed FDA?

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Fri May 24, 2024 1:07 pm
by cgiard
z-fan88 wrote:Is there a work-around to have the OS just ignore the disk instead of throwing up the offer to format the zfs member disks?


I think it will automatically ignore the disks if it is at least partitioned with a zfs partition type. If it was used as a raw disk I'm not sure what would need to be done.

z-fan88 wrote:... it seems like one should be able to use Automator to make a script that can be compiled and that one thing could be allowed FDA?


It would still need to at least call the zpool command, but since you have that listed it might work?

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Fri May 24, 2024 1:38 pm
by z-fan88
Ah, yes, I set them up as whole disks. Maybe I'll try with partitions as you suggest. Thanks again.

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Wed May 29, 2024 3:10 am
by z-fan88
Ok, interesting. I destroyed the pool, then connected the disks one by one to a linux system and blew out all the formatting. Using fdisk on Linux I GPT formatted the disks, created a 100MB partition 1 type Microsoft Data and the remainder partition 2 type zfs (aka solaris /usr if I recall correctly). Then I put the disks back on the mac and redid the pool defining the slices for ZFS to use as the partition 2's on all four disks.

Now not only does Disk Utility not complain about the disks at all upon boot, but the pool does auto-mount!

Success then I suppose!

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Wed May 29, 2024 4:36 am
by jawbroken
roughly this kind of setup happened automatically for me when just using OpenZFS on OS X and letting it format the disks. it doesn't see the drives as unformatted and throw up the message to format them, and in `diskutil list` they have an additional 8.4 MB slice as well as the ZFS one

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Wed May 29, 2024 4:59 am
by z-fan88
jawbroken wrote:roughly this kind of setup happened automatically for me when just using OpenZFS on OS X and letting it format the disks. it doesn't see the drives as unformatted and throw up the message to format them, and in `diskutil list` they have an additional 8.4 MB slice as well as the ZFS one


Yeah, the undesired behaviour I saw was probably due to the way I created the pool (by defining using disk/by-serial), though the first time I did call the whole disk not a partition. Do you remember how you defined the disks in your zpool create command? For example was it zpool create tank mirror /dev/disk1 /dev/disk2 or similar?

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Thu May 30, 2024 5:13 am
by jawbroken
my exact command was
Code: Select all
zpool create -f -o ashift=12 -O casesensitivity=insensitive -O atime=off -O normalization=formD estorage raidz2 disk6 disk8 disk9 disk10 disk13 disk14 disk15 disk16 disk18 disk21 disk24 disk25

Re: auto mount on boot - 2.2.2 - Monterey

PostPosted: Thu May 30, 2024 5:18 am
by z-fan88
jawbroken wrote:my exact command was
Code: Select all
zpool create -f -o ashift=12 -O casesensitivity=insensitive -O atime=off -O normalization=formD estorage raidz2 disk6 disk8 disk9 disk10 disk13 disk14 disk15 disk16 disk18 disk21 disk24 disk25


Thanks!