OST_ALWAYS_MNTOPTS=${OST_ALWAYS_MNTOPTS:-",asyncdel"}
OST_DEFAULT_MNTOPTS=${OST_DEFAULT_MNTOPTS:-",extents,mballoc"}
OST_ALWAYS_MNTOPTS=${OST_ALWAYS_MNTOPTS:-",asyncdel"}
OST_DEFAULT_MNTOPTS=${OST_DEFAULT_MNTOPTS:-",extents,mballoc"}
if [ "${HATYPE_OPT}" != "${HBVER_HBV1}" ] \
&& [ "${HATYPE_OPT}" != "${HBVER_HBV2}" ] \
&& [ "${HATYPE_OPT}" != "${HATYPE_CLUMGR}" ]; then
if [ "${HATYPE_OPT}" != "${HBVER_HBV1}" ] \
&& [ "${HATYPE_OPT}" != "${HBVER_HBV2}" ] \
&& [ "${HATYPE_OPT}" != "${HATYPE_CLUMGR}" ]; then
"empty. Lustre services may not be started!"
return 1
fi
if [ -z "`grep ${MGS_TYPE} ${LUSTRE_PROC_DEVICES}`" ]; then
"empty. Lustre services may not be started!"
return 1
fi
if [ -z "`grep ${MGS_TYPE} ${LUSTRE_PROC_DEVICES}`" ]; then
# Get the hostnames of the nodes
for ((idx = 1, i = 1; idx < ${#HOST_NIDS[@]}; idx++, i++)); do
if [ -z "${HOST_NIDS[idx]}" ]; then
# Get the hostnames of the nodes
for ((idx = 1, i = 1; idx < ${#HOST_NIDS[@]}; idx++, i++)); do
if [ -z "${HOST_NIDS[idx]}" ]; then
if [ "${first_item}" != "${first_item#devices=}" ]; then
MD_DEVS[j]=`echo "${line}" | sed -e 's/devices=//' -e 's/,/ /g'`
fi
if [ "${first_item}" != "${first_item#devices=}" ]; then
MD_DEVS[j]=`echo "${line}" | sed -e 's/devices=//' -e 's/,/ /g'`
fi
| grep \"VG Name\" | awk '{print \$3}' | xargs"
ret_str=`${REMOTE} ${host_name} "${cmd}" 2>&1`
if [ $? -ne 0 ]; then
if [ -n "${ret_str}" ]; then
| grep \"VG Name\" | awk '{print \$3}' | xargs"
ret_str=`${REMOTE} ${host_name} "${cmd}" 2>&1`
if [ $? -ne 0 ]; then
if [ -n "${ret_str}" ]; then
# Execute remote command to get the kernel version
ret_str=`${REMOTE} ${host_name} "uname -r" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
# Execute remote command to get the kernel version
ret_str=`${REMOTE} ${host_name} "uname -r" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
ret_str=`${REMOTE} ${host_name} \
"grep ${target_svname} ${res_file}" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
ret_str=`${REMOTE} ${host_name} \
"grep ${target_svname} ${res_file}" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
"There are no heartbeat channel configs in ${HA_CF}" \
"of host ${host_name} or ${HA_CF} does not exist!"
return 0
"There are no heartbeat channel configs in ${HA_CF}" \
"of host ${host_name} or ${HA_CF} does not exist!"
return 0
if [ "${target_svname}" = "${MGS_SVNAME}" ]; then
# Execute remote command to get the device name of mgs target
ret_str=`${REMOTE} ${host_name} \
if [ "${target_svname}" = "${MGS_SVNAME}" ]; then
# Execute remote command to get the device name of mgs target
ret_str=`${REMOTE} ${host_name} \
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_devsize() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_devsize() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_realdevname() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_realdevname() error:" \
"remote command error: ${ret_str}"
echo "`basename $0`: get_stripecount() error: can't" \
"get stripe count of ${target_fsname} in ${host_name}!"
return 1
echo "`basename $0`: get_stripecount() error: can't" \
"get stripe count of ${target_fsname} in ${host_name}!"
return 1
"ldd_flags of target ${TARGET_DEVNAMES[i]}" \
"in host ${host_name} - it's value is null!"\
"Check ${TUNEFS} command!"
"ldd_flags of target ${TARGET_DEVNAMES[i]}" \
"in host ${host_name} - it's value is null!"\
"Check ${TUNEFS} command!"
# Get other format options of the lustre target
TARGET_FMTOPTS[i]=$(get_fmtopts ${TARGET_DEVNAMES[i]} ${host_name} "${params}")
if [ $? -ne 0 ]; then
# Get other format options of the lustre target
TARGET_FMTOPTS[i]=$(get_fmtopts ${TARGET_DEVNAMES[i]} ${host_name} "${params}")
if [ $? -ne 0 ]; then
# Get the stripe count option
stripecount_opt=$(get_stripecount_opt ${host_name} ${TARGET_FSNAMES[i]})
if [ $? -ne 0 ]; then
# Get the stripe count option
stripecount_opt=$(get_stripecount_opt ${host_name} ${TARGET_FSNAMES[i]})
if [ $? -ne 0 ]; then
- ret_str=`${REMOTE} ${host_name} "/sbin/debugfs -R 'stats -h' \
- ${target_devname} | grep 'Journal inode:'" 2>&1`
+ ret_str=`${REMOTE} ${host_name} "PATH=\$PATH:/sbin:/usr/sbin \
+debugfs -R 'stats -h' ${target_devname} | grep 'Journal inode:'" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_journalsize() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_journalsize() error:" \
"remote command error: ${ret_str}"
- ret_str=`${REMOTE} ${host_name} "/sbin/debugfs -R \
- 'stat <${journal_inode}>' ${target_devname}|grep '^User:'" 2>&1`
+ ret_str=`${REMOTE} ${host_name} "PATH=\$PATH:/sbin:/usr/sbin \
+debugfs -R 'stat <${journal_inode}>' ${target_devname}|grep '^User:'" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_journalsize() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_journalsize() error:" \
"remote command error: ${ret_str}"
- ret_str=`${REMOTE} ${host_name} "/sbin/debugfs -R 'stats -h' \
- ${target_devname} | grep 'Block count:'" 2>&1`
+ ret_str=`${REMOTE} ${host_name} "PATH=\$PATH:/sbin:/usr/sbin \
+debugfs -R 'stats -h' ${target_devname} | grep 'Block count:'" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: figure_journal_size() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: figure_journal_size() error:" \
"remote command error: ${ret_str}"
- ret_str=`${REMOTE} ${host_name} "/sbin/debugfs -R 'stats -h' \
- ${target_devname} | grep 'Inode count:'" 2>&1`
+ ret_str=`${REMOTE} ${host_name} "PATH=\$PATH:/sbin:/usr/sbin \
+debugfs -R 'stats -h' ${target_devname} | grep 'Inode count:'" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_ratio() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_ratio() error:" \
"remote command error: ${ret_str}"
- ret_str=`${REMOTE} ${host_name} "/sbin/debugfs -R 'stats -h' \
- ${target_devname} | grep 'Block count:'" 2>&1`
+ ret_str=`${REMOTE} ${host_name} "PATH=\$PATH:/sbin:/usr/sbin \
+debugfs -R 'stats -h' ${target_devname} | grep 'Block count:'" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_ratio() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_ratio() error:" \
"remote command error: ${ret_str}"
- ret_str=`${REMOTE} ${host_name} "/sbin/debugfs -R 'stats -h' \
- ${target_devname} | grep 'Inode size:'" 2>&1`
+ ret_str=`${REMOTE} ${host_name} "PATH=\$PATH:/sbin:/usr/sbin \
+debugfs -R 'stats -h' ${target_devname} | grep 'Inode size:'" 2>&1`
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_isize() error:" \
"remote command error: ${ret_str}"
if [ $? -ne 0 -a -n "${ret_str}" ]; then
echo "`basename $0`: get_isize() error:" \
"remote command error: ${ret_str}"
ratio_opt=$(get_i_opt ${host_name} ${TARGET_DEVNAMES[i]} \
${TARGET_DEVTYPES[i]} ${TARGET_DEVSIZES[i]})
if [ $? -ne 0 ]; then
ratio_opt=$(get_i_opt ${host_name} ${TARGET_DEVNAMES[i]} \
${TARGET_DEVTYPES[i]} ${TARGET_DEVSIZES[i]})
if [ $? -ne 0 ]; then
inode_size_opt=$(get_I_opt ${host_name} ${TARGET_DEVNAMES[i]} \
${TARGET_DEVTYPES[i]} ${TARGET_FSNAMES[i]})
if [ $? -ne 0 ]; then
inode_size_opt=$(get_I_opt ${host_name} ${TARGET_DEVNAMES[i]} \
${TARGET_DEVTYPES[i]} ${TARGET_FSNAMES[i]})
if [ $? -ne 0 ]; then