Skip to content

Commit 6379c5f

Browse files
Andrew J. Hesfordahesford
authored andcommitted
core-services/03-filesystems.sh: initialize ZFS even with no cachefile
1 parent 92d68f8 commit 6379c5f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

core-services/03-filesystems.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ if [ -e /etc/crypttab ]; then
3030
fi
3131
fi
3232

33-
if [ -e /etc/zfs/zpool.cache -a -x /usr/bin/zfs ]; then
34-
msg "Activating ZFS devices..."
35-
zpool import -c /etc/zfs/zpool.cache -N -a
33+
if [ -x /usr/bin/zpool -a -x /usr/bin/zfs ]; then
34+
if [ -e /etc/zfs/zpool.cache ]; then
35+
msg "Importing cached ZFS pools..."
36+
zpool import -N -a -c /etc/zfs/zpool.cache
37+
else
38+
msg "Scanning for and importing ZFS pools..."
39+
zpool import -N -a -o cachefile=none
40+
fi
3641

3742
msg "Mounting ZFS file systems..."
3843
zfs mount -a

0 commit comments

Comments
 (0)