Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: USB Hard Drive Question

  1. #1

    Join Date
    Dec 2016
    State
    Barden Ridge NSW
    Posts
    3,257
    Mentioned
    168 Post(s)
    Quoted
    1201 Post(s)
    Australia

    USB Hard Drive Question

    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?.

  2. #2

    Join Date
    Mar 2006
    State
    Brisbane, Australia
    Posts
    11,470
    Mentioned
    185 Post(s)
    Quoted
    1425 Post(s)
    Australia
    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

  3. #3

    Join Date
    Mar 2017
    State
    Victoria
    Posts
    2,447
    Mentioned
    59 Post(s)
    Quoted
    838 Post(s)
    Australia
    Quote Originally Posted by Brad View Post
    Linux would definitely have the same option just not sure what that off the top of my head.
    Probably somewhere in hdparm or smartctl.

    - - - Updated - - -

    This might be useful: https://wiki.archlinux.org/index.php/hdparm
    Live on Twitch, Tuesdays 6pm + other random times | twitch.tv/ajfclark | You can vote for what machine I play, click here, follow my channel and type '!vote' in chat for details | Movember: mobro.co/ajfclark

  4. #4

    Join Date
    Jul 2018
    State
    Victoria
    Posts
    57
    Mentioned
    2 Post(s)
    Quoted
    22 Post(s)
    Australia
    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

  5. #5

    Join Date
    Dec 2016
    State
    Barden Ridge NSW
    Posts
    3,257
    Mentioned
    168 Post(s)
    Quoted
    1201 Post(s)
    Australia

    Quote Originally Posted by Eurotimmy View Post
    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.



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



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


  6. #6

    Join Date
    Apr 2012
    State
    qld
    Posts
    3,202
    Mentioned
    94 Post(s)
    Quoted
    965 Post(s)
    Australia
    Would SSD Be a better option? no moving disks
    I guess price would be a factor though

  7. #7

    Join Date
    Dec 2016
    State
    Barden Ridge NSW
    Posts
    3,257
    Mentioned
    168 Post(s)
    Quoted
    1201 Post(s)
    Australia

    Quote Originally Posted by jason1 View Post
    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.

  8. #8

    Join Date
    Jul 2018
    State
    Victoria
    Posts
    57
    Mentioned
    2 Post(s)
    Quoted
    22 Post(s)
    Australia
    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

  9. #9

    Join Date
    Dec 2016
    State
    Barden Ridge NSW
    Posts
    3,257
    Mentioned
    168 Post(s)
    Quoted
    1201 Post(s)
    Australia

    Quote Originally Posted by Eurotimmy View Post
    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.

  10. #10

    Join Date
    Jul 2018
    State
    Victoria
    Posts
    57
    Mentioned
    2 Post(s)
    Quoted
    22 Post(s)
    Australia
    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

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 23rd January 2012, 09:18 PM
  2. Get M.A.M.E. Hard Drive Clone
    By biggeorge in forum Mame Cab Projects and Discussion
    Replies: 10
    Last Post: 26th April 2009, 06:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •