Exist if partitionned disks are found

This commit is contained in:
Jeremy Gardais 2018-06-25 17:07:19 +02:00
parent 03a3f7ac29
commit a89e47c370
1 changed files with 11 additions and 1 deletions

View File

@ -12,12 +12,22 @@ DISK_TEMP_LIST="/tmp/zfs.disks"
# Store disks list in a temp file # Store disks list in a temp file
find /dev/disk/by-vdev -maxdepth 1 -type l -printf "%f\\n" > "${DISK_TEMP_LIST}" 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" if ! lsmod | grep -q "^zfs"
then then
printf "%b\\n" "Try to load ZFS module" printf "%b\\n" "Try to load ZFS module"
modprobe zfs modprobe zfs
fi 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 {{{ # Pool creation {{{
## Initialize loop vars ## Initialize loop vars