automate echo command on usb event

Sebastian Spiess sebastian.spiess at gmail.com
Wed Feb 20 11:26:32 GMT 2008


hi all,

I have a FreeAgendGo external 2.5" hdd. the hdd is running fine exept that before I can use it without problems I always 
have to do the following

	dmesg|tail

which gives me something like

[ 1280.152000] sdb: assuming drive cache: write through
[ 1280.152000]  sdb: sdb1 sdb2
[ 1280.172000] sd 2:0:0:0: Attached scsi disk sdb
[ 1280.172000] sd 2:0:0:0: Attached scsi generic sg2 type 0
[ 1280.556000] NTFS-fs warning (device sdb1): parse_options(): Option utf8 is no longer supported, using option nls=utf8. 
Please use option nls=utf8 in the future and make sure utf8 is compiled either as a module or into the kernel.

then I can do a

	sudo echo 1 >/sys/class/scsi_disk/2\:0\:0\:0/allow_restart


and the drive works fine.
troube is sometimes it is not sdb or not scsi_disk/2\:0\:0\:0
how can I make the command that is will work everytime, or even better, automatically?



More information about the ubuntu-au mailing list