Re: Western Digital RE3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Henry, Andrew wrote:
I'm told that my script to keep "FreeAgent" USB external drives from
doing that also works with similar other drives which want to sleep. I
have *not* verified that (having none and no time), but if you want the
script to try on your own, I think I posted it here, or could put it up
on request.

--
bill davidsen <davidsen@xxxxxxx>
  CTO TMR Associates, Inc

That would be great!  I would definitely like to have a script that keeps drives alive.  Can you send it privately (keep the list archive smaller) or put it on the net?

This is the version I posted, I've played with some extra features, but since you may want to modify it, simple is best. It's small enough to just send.

--
bill davidsen <davidsen@xxxxxxx>
 CTO TMR Associates, Inc

"You are disgraced professional losers. And by the way, give us our money back."
   - Representative Earl Pomeroy,  Democrat of North Dakota
on the A.I.G. executives who were paid bonuses  after a federal bailout.


#!/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@xxxxxxx
# 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 -v <<XX
# Start the drive
sdparm --command=start /dev/${disk}
# Clear the standby
sdparm --clear STANDBY -6 /dev/${disk}
# Allow restart
cd /sys/block/${disk}/device/scsi_disk*
if [ -f allow_restart ]; then
 echo 1 >allow_restart
fi

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux