Don't bother to invoke gmirror or zpool if the module is not loaded.

This commit is contained in:
Alexander Motin 2016-03-11 14:24:32 +00:00
parent edfb94f75b
commit 5f7bd9a1c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=296656

View File

@ -263,6 +263,9 @@ delete_all_gpart()
# Function to export all zpools before starting an install
stop_all_zfs()
{
if [ ! -c /dev/zfs ]; then
return;
fi
local DISK="`echo ${1} | sed 's|/dev/||g'`"
# Export any zpools using this device so we can overwrite
@ -278,6 +281,9 @@ stop_all_zfs()
# Function which stops all gmirrors before doing any disk manipulation
stop_all_gmirror()
{
if [ ! -d /dev/mirror ]; then
return;
fi
local DISK="`echo ${1} | sed 's|/dev/||g'`"
GPROV="`gmirror list | grep ". Name: mirror/" | cut -d '/' -f 2`"
for gprov in $GPROV