Commit af903888 authored by Mike Hibler's avatar Mike Hibler

For write-cache, if camcontrol fails, try smartctl.

camcontrol cannot change the cache settings on "ada" devices.
parent ca7027f0
#! /bin/bash
#
# Copyright (c) 2013 University of Utah and the Flux Group.
# Copyright (c) 2013-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -558,7 +558,11 @@ getwcache() {
fi
elif [ "$os" == "FreeBSD" ] ; then
# try camcontrol first
cmc=$(which camcontrol)
if [ "$osrel" == "10" ] ; then
cmc=$(which camcontrol10)
else
cmc=$(which camcontrol)
fi
#set -x
if [ "${cmc/camcontrol}" != "${cmc}" ] ; then
sd=${1#/dev/}
......@@ -570,9 +574,10 @@ getwcache() {
printf " %s:%d " "Setting WCE" ${$sd} >> ${logfile4tb}
/usr/local/etc/emulab/camwce -P on $sd > /dev/null 2>&1
fi
fi
#set +x
else
# don't have don't have camcontrol, maybe we can use smartctl
# don't have don't have camcontrol or it did not work, try smartctl
if [ "$res" == "NA" ] ; then
smtcl=$(findSmartctl_getopt)
if [ "${smtcl/smartctl}" != "$smtcl" ] ; then
x=$($smtcl --get=wcache $1 | grep -i Write | grep -i cache)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment