diff --git a/zpool.creation.sh b/zpool.creation.sh index a660938..776d94c 100755 --- a/zpool.creation.sh +++ b/zpool.creation.sh @@ -12,12 +12,22 @@ DISK_TEMP_LIST="/tmp/zfs.disks" # Store disks list in a temp file find /dev/disk/by-vdev -maxdepth 1 -type l -printf "%f\\n" > "${DISK_TEMP_LIST}" -# Test zfs module {{{ +# Tests {{{ + +## zfs module {{{ if ! lsmod | grep -q "^zfs" then printf "%b\\n" "Try to load ZFS module" modprobe zfs fi +## }}} +## If a previous ZFS partitioning already exists {{{ +if find /dev/disk/by-vdev -maxdepth 1 -type l -iname "*part[0-9]*" > /dev/null 2>&1 +then + printf "%b\\n" "Some disks are already partitioned, please verify that you don't have a working ZFS configuration !" + exit 1 +fi +## }}} # }}} # Pool creation {{{ ## Initialize loop vars