Help with UDEV and script

Sebastian Spiess sebastian.spiess at gmail.com
Fri Nov 23 10:48:18 GMT 2007


hi all,
I am a bit lost and I hope one of you out there knows more than me about this.

This would really help me as I am off for holidays/travel and need the drive. (bought it for that purpose :-| )
I recently posted about my FreeAgend Go USB HDD.

I found a bug report which has a fix https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/61235/comments/71

in there the author tells us about a script and his exp with it, it made the damn thing work...

But I am a bit lost, I placed the script below in /usr/sbin

-----
#!/bin/bash -e
# brian at aljex.com
# https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/61235
#
# config option, two possible ways to fix drive
# true: allows the drive to spin down when idle, tells kernel to wait gracefully.
# false: drive never goes to sleep.
ALLOW_RESTART=true # true or false

# don't run unless udev ran us
[ "$UDEVD_EVENT" = "1" ] || { echo "This should only be run from udev." ; exit 1 ; }

# don't do anything unless the target is a disk, but don't error either.
[ "$SUSBSYSTEM" = "block" ] || exit 0

$ALLOW_RESTART && {
         echo 1 > /sys/class/scsi_disk/${PHYSDEVPATH##*/}/allow_restart
} || {
         sdparm --clear STANDBY -6 $DEVNAME
}
-----

in a file and made it executable.

then I think he suggest to put it in /usr/sbin and add some line ( RUN+="fix_usb_hd" ) to a UDEV rule... but where? or am I 
wrong?


Any help welcome



More information about the ubuntu-au mailing list