From: Richard Yao Date: Sat, 21 Jul 2012 17:41:38 +0000 (-0400) Subject: Force ZFS to explicitly import pool when LUKS is present X-Git-Tag: v3.4.40~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e05ab0d1a1e739e152ec6ef77a6335891f34fe2b;p=genkernel.git Force ZFS to explicitly import pool when LUKS is present --- diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 46364de..4f0ce1b 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -674,7 +674,14 @@ startVolumes() { if [ "$(zpool list -H -o name ${ZFS_POOL} 2>&1)" = "$ZFS_POOL" ] then - good_msg "ZFS pool ${ZFS_POOL} already imported" + good_msg "ZFS pool ${ZFS_POOL} already imported." + + if [ -n "${CRYPT_ROOT}" -o -n "${CRYPT_SWAP}" ] + then + good_msg "LUKS detected. Reimporting ${ZFS_POOL}" + /sbin/zpool export -f "${ZFS_POOL}" + /sbin/zpool import -N "${ZPOOL_FORCE}" "${ZFS_POOL}" + fi else good_msg "Importing ZFS pool ${ZFS_POOL}"