#!/bin/bash # FreeAgentFix 1.4 2008-02-17 19:45:13-05 root Stable #================================================================ # FreeAgentFix - fix "Free Agent" USB drives going off line in Linux # Author: davidsen@tmr.com # Based on discussions in LKML and similar lists # brings the drive online # clears standby # Tells the kernel to allow restart # sanity check if [ $# -lt 1 ]; then echo "FreeAgentFix v1.4 - keeps \"Free Agent\" drives online in Linux" echo echo "Usage:" echo " ./FreeAgentFix sdX" echo echo "Where \"X\" is the drive letter assigned when the drive is connected" echo echo "Plug in the drive, see what device name is assigned to the drive" echo "using \"dmesg | tail -10\" or similar" echo "run the script with the drive name only (without /dev/)" echo echo # this should be made executable (chmod +x FreeAgentFix) but if # someone sources it, don't mess them up fn=${0##*/} if [ "$fn" == "FreeAgentFix" ]; then exit; else return fi fi disk=$1 bash -xv <allow_restart fi