cbreak-black / ZetaWatch

ZFS OSX Menu Bar widget
BSD 3-Clause "New" or "Revised" License
145 stars 11 forks source link

Import certain pool with zfs import -f (Feature Request) #9

Closed lzhang10 closed 4 years ago

lzhang10 commented 4 years ago

I share my pool between MacOS and Linux in a dual boot fashion. Whenever I did some work on the Linux side the next time when I boot into MacOS the pool will not be imported automatically by ZetaWatch. Presumably this is because the pool was not exported upon shutdown, or hostid mismatch. Since at anytime only one OS has access to the pool in my setting, it is safe to fix it by running zfs import -f <pool> manually.

I understand one does not want an option to enable force import of all pools.
Is there a way to do a force import for selected pool automatically?

cbreak-black commented 4 years ago

Try https://github.com/cbreak-black/ZetaWatch/releases/tag/r41, I added functionality to ignore mismatching host id values when auto-importing pools. Since I don't have any pools with mismatching host id at the moment, I couldn't test the changes though.

Please test it for me and report any weirdness :D

lzhang10 commented 4 years ago

I installed the r41 pre-release.

I then boot into Linux to import a pool. Re-boot to Mac and can confirm when "allow host id mismatch" is checked the pool in question can be imported automatically. This was previously not possible.

This works as expected, no weirdness :-)

cbreak-black commented 4 years ago

Nice. I've released that build. But wouldn't you have the same problem in the other direction, with linux not importing the pool?

lzhang10 commented 4 years ago

I import with zpool import -f <pool> on Linux side. This always works.