Execute isso a cada minuto com o usuário root para limpar os registros de uma determinada porta:
#!/bin/bash
tmpfile="$(mktemp)"
sync; sync; sync
fgrep -iIR "] usb 2-3: " /var/log/* 2>/dev/null | fgrep -i " and address " | awk '{ print $NF }' | sort -u | while read i; do
egrep -iIR "] usb-storage: waiting|] usb-storage: device |usb-storage: device found at $i| scsi$i : SCSI emulation for|] scsi $i:|] sd $i:" /var/log/* 2>/dev/null
grep -iIR "] sd $i:0:0:0: \[*.*\] Write P" /var/log/* 2>/dev/null | sed 's/\[//g; s/\]//g' | awk '{print $9}' | sort -u | while read ONEDEV; do grep -iIR "$ONEDEV: " /var/log/* 2>/dev/null; done
fgrep -iIR "] usb 2-3: " /var/log/* 2>/dev/null
done > "$tmpfile"
while read ONELINE; do
FILENAME="'echo "$ONELINE" | cut -d : -f 1'"
STRING="'echo "$ONELINE" | sed 's/:/\n/' | fgrep -v "/var/log" | sed 's/\[/\\[/g' | sed 's/\]/\\]/g' | sed 's/\//\\\//g''"
echo "$FILENAME XXX $STRING"
sed -i "/$STRING/d" "$FILENAME"
done < "$tmpfile"
rm "$tmpfile"
dmesg -c > /dev/null