summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew J. Hesford <ahesford@gleason.com>2020-07-11 23:16:10 -0400
committerAndrew J. Hesford <48421688+ahesford@users.noreply.github.com>2020-07-17 15:44:51 -0400
commit6379c5ff47ac5b1d64b9e9b47d94931bdfdc8162 (patch)
tree44aaf615b2abf65bc418274fb8069a4166ca61a6
parent92d68f8354720e5e24457858116cfd9f39617a82 (diff)
downloadrunit-void-6379c5ff47ac5b1d64b9e9b47d94931bdfdc8162.tar.gz
runit-void-6379c5ff47ac5b1d64b9e9b47d94931bdfdc8162.tar.xz
runit-void-6379c5ff47ac5b1d64b9e9b47d94931bdfdc8162.zip
core-services/03-filesystems.sh: initialize ZFS even with no cachefile
-rw-r--r--core-services/03-filesystems.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/core-services/03-filesystems.sh b/core-services/03-filesystems.sh
index 9bb3db4..5430646 100644
--- a/core-services/03-filesystems.sh
+++ b/core-services/03-filesystems.sh
@@ -30,9 +30,14 @@ if [ -e /etc/crypttab ]; then
     fi
 fi
 
-if [ -e /etc/zfs/zpool.cache -a -x /usr/bin/zfs ]; then
-    msg "Activating ZFS devices..."
-    zpool import -c /etc/zfs/zpool.cache -N -a
+if [ -x /usr/bin/zpool -a -x /usr/bin/zfs ]; then
+    if [ -e /etc/zfs/zpool.cache ]; then
+        msg "Importing cached ZFS pools..."
+        zpool import -N -a -c /etc/zfs/zpool.cache
+    else
+        msg "Scanning for and importing ZFS pools..."
+        zpool import -N -a -o cachefile=none
+    fi
 
     msg "Mounting ZFS file systems..."
     zfs mount -a