#! /bin/sh
# Disable SCSI WRITE_SAME, which is not supported by underlying disk 
# emulation.  Run on boot from, eg, /etc/rc.local
#
# See http://www.it3.be/2013/10/16/write-same-failed/
#
# Written by Ewen McNeill <ewen@naos.co.nz>, 2014-07-17
#---------------------------------------------------------------------------

find /sys/devices -name max_write_same_blocks | 
    while read DISK; do 
        echo 0 >"${DISK}"
    done
