summary refs log tree commit diff
diff options
context:
space:
mode:
authorDominik Honnef <dominik@honnef.co>2016-05-25 20:38:48 +0200
committerJuan RP <xtraeme@gmail.com>2016-05-25 20:38:48 +0200
commitab7f9c1f98d63c9e39008a8a2ab138093c82ce12 (patch)
tree1177111e977c161610a136cc81f390e119dec400
parentb9767c6c6ffc24c7d323a0b518c9fd01f8dc3d00 (diff)
downloadrunit-void-ab7f9c1f98d63c9e39008a8a2ab138093c82ce12.tar.gz
runit-void-ab7f9c1f98d63c9e39008a8a2ab138093c82ce12.tar.xz
runit-void-ab7f9c1f98d63c9e39008a8a2ab138093c82ce12.zip
Import and mount ZFS at boot time (#46)
-rw-r--r--core-services/03-filesystems.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/core-services/03-filesystems.sh b/core-services/03-filesystems.sh
index c07dfd1..9bb3db4 100644
--- a/core-services/03-filesystems.sh
+++ b/core-services/03-filesystems.sh
@@ -30,6 +30,22 @@ 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
+
+    msg "Mounting ZFS file systems..."
+    zfs mount -a
+
+    msg "Sharing ZFS file systems..."
+    zfs share -a
+
+    # NOTE(dh): ZFS has ZVOLs, block devices on top of storage pools.
+    # In theory, it would be possible to use these as devices in
+    # dmraid, btrfs, LVM and so on. In practice it's unlikely that
+    # anybody is doing that, so we aren't supporting it for now.
+fi
+
 [ -f /fastboot ] && FASTBOOT=1
 [ -f /forcefsck ] && FORCEFSCK="-f"
 for arg in $(cat /proc/cmdline); do