Jump to content
Due to a large amount of spamers, accounts will now have to be approved by the Admins so please be patient. ×
IGNORED

USB Hard Drive Question


Recommended Posts

Goodaye guys. I have a RPi running OpenLec as my media player down my farm. I have no internet access so everything is dumped on the 2TB USB HDD.

 

The RPi is powered on full time running off the solar charged batteries via a buck inverter to get the 5vDC with the USB HDD powered off a powered hub again, powered all the time and everything has been running flawlessly until about a month ago when the HDD come to the end of it's life after running for 3 years.

 

Something I sort of expected considering they aren't designed to spin non stop all there life.

 

My question is can I put a switch in the USB HDD red supply wire so when not in use, between visits, I can power down the HDD?.

 

The switch will be a relay actually that comes on when the radio is on. The Radio has a power wire and standby supply going to it. The standby so the radio doesn't loose it's memory but it is this memory supply that keeps the RPi powered as well.

 

What I want is to continue using the RPi powered all the time as I have had no SD card corruption problems doing it this way but a simple way the HDD powers down when I'm not there.

 

Is it as simple as killing the red wire in the USB cable going to the HDD rather than physically unplugging the HDD that I have been doing since replacing it?.

Link to comment
Share on other sites

  • Administrators

I don't why you couldn't install a switch into the power cord or similiar when not in use. BUT I'm going to assume that this is a 2.5" laptop size usb drive rather than a 3.5" full drive as they always have a power switch on them.

 

Thing is, that these drives should stop spinning automatically when not in use. In windows its automatic. Linux would definitely have the same option just not sure what that off the top of my head. So rather than a hardware hack, just enable this feature in the OS. Time out will be a value and it would stop spinning.

 

Brad

Link to comment
Share on other sites

Hey Autosteve, I love the sound of your setup. All things solar and RPi I find interesting.

 

In my setup (which admittedly I’ve not toyed around with for years) I put in a switch connected to a spare GPIO that when I throw that switch it performs a safe shutdown command on the RPi and in turn that politely disconnects the devices (USB / Bluetooth / etc) and that way between visits the only thing running is my solar to replenish the batteries.

 

On the next visit I just restart the RPi and all is well again.

 

I’ll search about for the shutdown script if you like but there’s plenty about it in Google for you to chose the one you like best.

 

 

Sent from my iPhone using Aussie Arcade

Link to comment
Share on other sites

Hey Autosteve, I love the sound of your setup. All things solar and RPi I find interesting.

 

In my setup (which admittedly I’ve not toyed around with for years) I put in a switch connected to a spare GPIO that when I throw that switch it performs a safe shutdown command on the RPi and in turn that politely disconnects the devices (USB / Bluetooth / etc) and that way between visits the only thing running is my solar to replenish the batteries.

 

On the next visit I just restart the RPi and all is well again.

 

I’ll search about for the shutdown script if you like but there’s plenty about it in Google for you to chose the one you like best.

 

 

Sent from my iPhone using Aussie Arcade

 

Sounds very similar to my setup as mine does have a safe shutdown script and that is one of the main reasons I have been reluctant to upgrade from OpenLec. Basically, if it ain't broke, don't stuff with it especially when someone from Canada using TeamViewer wrote the Linux safe shutdown script part into the version of Openlec for me on my computer when he compiled the SD card as I cannot get my head around software and have to rely on others to do it for me. Hardware is my forte I'm afraid.

 

On my setup I have a two way momentary switch that when toggled forward, it activates the safe shutdown script via a pin on the GPIO and the switch's ground wire. Toggling the switch backwards is one of my hardware hacks. It grounds the RPi processor's reset pin and is used when the RPi locks up preforming a full reset of the whole system so no need to ever do a power down/ power up reset should the system lock up.

 

The RPi I'm using is a RPi 2 B which is boarder line being able to power a USB powered hard drive directly and that is why I it is powered via a powered hub rather than the RPi USB port directly.

 

The problem then is the HDD is powered all the time by the powered USB hub. What I want to do is physically cut the red wire in the USB cable going from the powered USB HUB to the USB powered hard drive so it stops the 5vDC + getting to the hard drive when the unit isn't being used.

 

By the way the 2TB USB powered HDD I'm using this time is a Toshiba Canvio Basics 2TB.

 

This is the whole RPi part of the media player. RPi, powered HUB, USB HDD, 12 volt to 5 volt 3 amp power supply, and switch panel.

 

nMYhpqb.jpg

 

It slides in here on rails into the media center cabinet....

 

EFI895j.jpg

 

And the media center bolts to one of the building posts....

 

bDrVhkP.jpg

Link to comment
Share on other sites

Would SSD Be a better option? no moving disks

I guess price would be a factor though

 

Cost. A standard 2TB USB HDD cost me about $110. Make that a SS 2TB and I would expect that to a God's ransom. I was told life expectancy would be roughly 3 years of constant use so I figure if I turn it off I should get probably 10 years not that I will probably still be using a RPi for this job by then. The RPi has a 64GB thumbstick as well as the 2TB so I never loose all the content if the USB HDD dies it's more all the data that just vanishes and the need to replace. Just better to make it last longer.

Link to comment
Share on other sites

Man... this is a pretty high-tech farm. I’m not gonna ask what you’re farming. :)

 

Ok, possibly an idea...

 

Because the drive is appearing to (if I see correctly) be powered by the powered hub could you put in one of those cheap ($2) single opto-isolated relay boards and kill the power to the 5v line in the HDD USB cable?

 

Bit of a hack though I guess...

 

 

Sent from my iPhone using Aussie Arcade

Link to comment
Share on other sites

Man... this is a pretty high-tech farm. I’m not gonna ask what you’re farming. :)

 

Ok, possibly an idea...

 

Because the drive is appearing to (if I see correctly) be powered by the powered hub could you put in one of those cheap ($2) single opto-isolated relay boards and kill the power to the 5v line in the HDD USB cable?

 

Bit of a hack though I guess...

 

 

Sent from my iPhone using Aussie Arcade

 

Yer I'm just wondering if killing just the +5volt red wire to the HDD will worry it considering the other 3 wires in the USB cable all still go back to the RPi.

 

As for the farming at the moment it is all just native animals with a couple of ferals in there as well. The actual paying crop would be lumber with a good mix of pine / eucalyptus with shitloads of tea tree. High tech, before the RPi and OpenLec it was an original Xbox running XBMC but that uses 240 volt where as the RPi uses 5 volt. Solar and batteries are 12vDC and with a 12vDC TV and car radio as the sound and speakers, the whole media system uses just 12volts and 5 volts so no need for an inverter to generate 240vAC.

 

The Xbox had a 2TB worth of content as well.

 

Content is mainly movies, pictures, music and music video with a lot of YouTube how to videos in there as well and the TV is usually only used at night time when the solar has gone to bed so battery usage is a premium.

Link to comment
Share on other sites

I loved that Xbox. I kept them in storage... somewhere... anyway.

 

Could you try this possibly to see how your drive behaves...

 

Go in to the shell command area on the RPi and type this:

(Which should unmount the USB disk)

 

sudo umount /dev/sdb1

 

I’m thinking that within some minutes (unknown to me) it’ll realise it’s been unmounted and spin down.

 

To note this command won’t shutdown the RPi but if the command sleeps the HDD would be able to add the line to your shutdown script.

 

Also, cutting the power to your HDD is pretty brutal particularly because the files may not be written / still open when you kill the power.

 

 

Sent from my iPhone using Aussie Arcade

Link to comment
Share on other sites

  • Administrators
I guess my alternative is update the RPi model, one that can power the HDD directly off it's USB ports and then when the RPi is put into standby, the HDD should spin down?.

 

This is what I would do. Have the Rpi, use its in-built options to shut the drive down.

 

Brad

Link to comment
Share on other sites

This is what I would do. Have the Rpi, use its in-built options to shut the drive down.

 

Brad

 

That is pretty much my thinking. Update to a RPi 3 where I have 4 USB ports instead of just two like my model has with ports powerful enough to drive the plug in USB 3 HDD where as my model RPi doesn't. Use the inbuilt BluTooth feature the RPi 3 has instead of the plug in USB BluTooth mine uses for the keyboard connection and that leaves 3 spare USB ports, one of which I use for adding content from Sydney, ( a 32GB thumbdrive) and use one other USB port for the 64GB thumbdrive I use for stored content that isn't on the HDD itself.

 

But here lies my problem going that way. I loose the safe shutdown script and the full CPU reset feature I added and because it is a RPi 3, my existing OpenLec software isn't compatible and my skills doing software for writing the image are totally non existent.

Link to comment
Share on other sites

  • 3 years later...

That's why I try to avoid storing information in computer aids. External and unexpected factors can occur at any time, influencing their work, later leading to several problems. After losing all the information on a USB hard drive, which later could not be restored, I completely gave it up. A friend passionate about technology give me the recommendation to store all the information in cloud-based software, they being the most secure. If the information is lost, it can be easily restored with the help of https://www.salvagedata.com/.

Edited by Wanne Lar
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...