• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Using the LED's as outputs  (Read 1631 times)
UnaClocker
Full Member
***

Karma: 0
Posts: 131



View Profile WWW
« on: July 05, 2010, 11:28:22 PM »

So I just can't for the life of me get my USB hard drive to stop crashing. After some random period of time, sometimes 3 days, sometimes 15 minutes, my USB hard drive will lock up. This requires me to power cycle the drive, shut down all the processes using it, umount and remount the darn thing.. Kind of a PITA.. So what I'm thinking of doing is setting up a basic script that runs in the background.. Every 30seconds or so, have it check a file on the USB drive, if it can't read it, kill the processes, umount the drive, and turn off one of the LED's. The LED output will be hooked to a transistor (say a 2n222 or similar) that'll trigger a relay that'll cut power to the USB drive. It'll wait, say, 3 seconds, and turn it back on. Wait another 30 seconds for it to be detected, and then remount and restart the processes. All automated so I don't have to futz with it anymore. Think that'll work well?
It's a shame the GuruPlug was a flop, I was hoping to move to that and use my drive via eSATA, where it's bound to be more reliable..
Logged

SheevaPlug - 8gb class 4 SDHC primary drive, 4tb 3.5" media drive, Debian Wheezy, nginx, Samba, Shorewall

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #1 on: July 06, 2010, 05:24:44 AM »

I have an Esata sheevaplug and don`t have that problem.
So far my plug has been running over 60 days without problem, and the only time I`ve needed to reboot was due to kernel change.
I know from my main P.C that USB drive enclosures can be unstable to say the least at times, have you tested out your drive enclosure on your P.C to see if that is your problem?

Also in my main P.C I fitted a Samsung 1 TB which would work for about 2 to 3 days before my computer would lock up , I replaced the drive for a Seagate 1TB drive and fixed the problem., why don`t ask me.
« Last Edit: July 06, 2010, 05:30:55 AM by peter a » Logged

MarkF
Full Member
***

Karma: 7
Posts: 144


View Profile
« Reply #2 on: July 06, 2010, 07:32:30 AM »

I don't know the answer to the original question.  Sorry.  It all sounds like it will work; but, I don't know for sure.

One idea though, once you toggle the power off/on for the USB drive, maybe you could toggle the power for the plug or enter runlevel 6 to make it reboot?  This would let the standard initialization processing/scripts take care of mounting drives and re-starting the other processes.  Just an idea. Smiley

I have been using a USB attached SSD boot/root drive for ~6 months without trouble.  This plug streams audio (SqueezeServer) 24/7 on my home network.  It has reset twice in those 6 months due to power outages; but, has come back up OK both times.  I believe this is because it is a UPS aware (using NUT) device and does an orderly shutdown before losing power completely.
Logged

Mark

UnaClocker
Full Member
***

Karma: 0
Posts: 131



View Profile WWW
« Reply #3 on: July 06, 2010, 07:54:15 PM »

I have an Esata sheevaplug and don`t have that problem.
So far my plug has been running over 60 days without problem, and the only time I`ve needed to reboot was due to kernel change.
I know from my main P.C that USB drive enclosures can be unstable to say the least at times, have you tested out your drive enclosure on your P.C to see if that is your problem?

Also in my main P.C I fitted a Samsung 1 TB which would work for about 2 to 3 days before my computer would lock up , I replaced the drive for a Seagate 1TB drive and fixed the problem., why don`t ask me.
Yes, before I got my SheevaPlug, I was using this drive with two different machines, one an old laptop that had a USB2.0 PCMCIA card in it. The other was an Atom based PC that had an ESATA port.. Both worked great without this drive ever locking up. I think I'd have no problems with this drive on an ESATA Plug..
This is a 1TB Seagate drie in a "Thermaltake" external enclosure.. I'll be upgrading to a 2TB here soon, because this drive is just about full now.
As for Mark's suggestion of rebooting the plug, I'd rather not.. I've had this thing up to 60 day uptimes a couple times before losing power. I recently picked up an old 500watt UPS and put a huge battery in it. The plug, cable modem, gigabit switch, and USB hard drive are the only things on the UPS, so I expect to be able to keep the plug going for 12+ hours when the power is out, which is long enough to cover all but the very worst outtages we have around here. I already have a "down" script that I run to kill the processes and umount the drive, and an "up" script that does the opposite.. I just want to automate the whole process.. (or fix the stinkin problem! heheh)
I would like to try a different enclosure at some point, see if that really is my problem.. None of the other USB devices crash..
Logged

SheevaPlug - 8gb class 4 SDHC primary drive, 4tb 3.5" media drive, Debian Wheezy, nginx, Samba, Shorewall

theYinYeti
Newbie
*

Karma: 0
Posts: 15


View Profile WWW
« Reply #4 on: September 13, 2010, 12:52:47 AM »

I don't know if this will help, or if it is related at all Here on my shining-new eSata SheevaPlug, I had a problem with files on the eSata (LVM) partition suddenly becoming unreadable, with weird listings (the kind with lots of ? instead of the usual rwx). At first, I thought that the partition was corrupted, but a total reboot (both the plug and the external enclosure) brought things back to normal. It happened again, though, with a totally different timing.

A bit of googling led me to believe that maybe this was related to the drive spinning-off, and the SheevaPlug being unaware of this. I setup a crontab, running this every hour:
Code:
sdparm --command=start /dev/sda

The problem disappeared. Maybe this could work over USB, too

Yves.
Logged

Pages: [1]
Print
Jump to: