sg_compare_and_write: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On Debian possible default full paths are:

/usr/bin/sg_compare_and_write - from package: sg3-utils

You may install the required package with command apt-get install {package}
Error in other languages:
sg_compare_and_write: bevel nie gevind nie
sg_compare_and_write: comandă negăsită
sg_compare_and_write: comando não encontrado
sg_compare_and_write: commande introuvable
sg_compare_and_write: command not found
sg_compare_and_write: käsku ei ole
sg_compare_and_write: không tìm thấy lệnh
sg_compare_and_write: komanda nerasta
sg_compare_and_write: Kommando nicht gefunden.
sg_compare_and_write: kommandot finns inte
sg_compare_and_write: komut yok
sg_compare_and_write: nie znaleziono polecenia
sg_compare_and_write: níor aimsíodh an t-ordú
sg_compare_and_write: no se encontró la orden
sg_compare_and_write: no s'ha trobat l'ordre
sg_compare_and_write: opdracht niet gevonden
sg_compare_and_write: parancs nem található
sg_compare_and_write: perintah tidak ditemukan
sg_compare_and_write: príkaz nenájdený
sg_compare_and_write: příkaz nenalezen
sg_compare_and_write: команда не найдена
sg_compare_and_write: командата не е открита
sg_compare_and_write: 命令找不到
sg_compare_and_write: コマンドが見つかりません