Created attachment 878653 [details, diff] patch adding stop() to /etc/init.d/zfs-import ZFS zfs-import doesn't have stop() functionality and cannot properly unmount zpool (zfs export -a). This causes a lot of error if zfs pool is on dmcrypt encrypted devices. Zfs still holds block devices because pool is imported and dmcrypt cannot close them. Example * crypt15 ... device-mapper: remove ioctl on crypt15 failed: Device or resource busy device-mapper: remove ioctl on crypt15 failed: Device or resource busy device-mapper: remove ioctl on crypt15 failed: Device or resource busy ... device-mapper: remove ioctl on crypt15 failed: Device or resource busy device-mapper: remove ioctl on crypt15 failed: Device or resource busy Device crypt15 is still in use. [ !! ] Dmcrypt errors significantly prolong shutdowns and reboots if system has a lot of encrypted drives. I'm attaching a patch which adds zfs-import stop() and I'll try to send it upstream. You may consider disabling ZPOOL_EXPORT='yes' by default just like ZFS_UNMOUNT to avoid hitting bug https://bugs.gentoo.org/647688. (My patch has this option enabled to be consistent with upstream code)