Command 'rescan-scsi-bus.sh -f' shows error "[-x: command not found"

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • sg3_utils-1.37-5.el7.x86_64
  • sg3_utils-1.28-6.el6.x86_64

Issue

  • The rescan-scsi-bus.sh -f command shows the following error:
[root@host ~]# rescan-scsi-bus.sh -f
Syncing file systems
Scanning SCSI subsystem for new devices, flush failed multipath devices, and remove devices that have disappeared
/bin/rescan-scsi-bus.sh: line 1091: [-x: command not found
Searching for remapped LUNs
Triggering udev to update device information... Done
0 new or changed device(s) found.
0 remapped or resized device(s) found.
0 device(s) removed.
  • This causes the flushing of multipath devices to fail.

Resolution

  • Issue currently tracked in Bug 1255564
  • Workaround is to edit /usr/bin/rescan-scsi-bus.sh and change:
if [ -n "$flush" ] ; then
  if [-x $MULTIPATH ] ; then
    flushmpaths 1
  fi
fi

To:

if [ -n "$flush" ] ; then
  if [ -x $MULTIPATH ] ; then
    flushmpaths 1
  fi
fi

Space added before '-x'

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.