zfs
zfs copied to clipboard
MacOS hangs on shutdown with pool with vdev file still alive
Short Story
Condition: With a still active/present vdev file as pool
when asking to shutdown or reboot my system, MacOS hangs forver...
Have to push 10 sec. the power-button
clue
- Shouldn't there be a LaunchAgent for shutdown ?
-
zpool export -a
-
- maybe a race condition on the APFS main filesystem, while ZFS file is still in use ?
- file
/vdev/zTest.dat
- file
Workaround
- do a manual
zpool export -a
before shuting down/rebooting
Test case
- Create zpool
mkdir /vdev
dd bs=4096 count=131072 if=/dev/zero of=/vdev/zTest.dat
zpool create zTest /vdev/zTest.dat
- shutdown (or reboot) MacOS through regular Apple menu
Config
MacBook Air (2012) with SSD (APFS) - macOS 10.14.6 (18G4032)/ Darwin 18.7.0
sysctl {spl,zfs}.kext_version
spl.kext_version: 1.9.4-0 zfs.kext_version: 1.9.4-0
Some possible solutions i've read over the web:
- Launchd script with
trap
trap myShutdown SIGTERM
trap myShutdown SIGKILL
- substute the
/sbin/shutdown
with a script (calling the realshutdown
) - creating a C (or whatever) program that could register himself for an XPC event
- called from a Launchd
Ref :
I've got the same problem as author has described, any suggestions?