Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions provisioners/zfs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/env bash -eux
# Use the first disk not assigned to a zpool already to create the data pool.
for DISK in $(cfgadm -al | awk -F\/ '/dsk/{ print $3 }' | awk '{ print $1 }'); do
if [[ -z $(zpool list -v | ggrep -E '^\s+${DISK}') ]]; then
for DISK in $(diskinfo -H | awk '{ print $2 }')
do
echo "Checking ${DISK}"
if [[ -z $(zpool list -H -v | egrep -e '^[[:blank:]]*'"${DISK}") ]]
then
echo "Found ${DISK}"
echo "[II] Adding data zpool using whole disk ${DISK}"
pfexec zpool create -f tank ${DISK}
break
Expand Down