The officially official Devuan Forum!

You are not logged in.

#1 2020-05-05 23:03:09

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Raspberry Pi 3B+ and USB HDD shutdown

Hello:

I'm currently in the process of setting up the hardware for a Raspberry Pi 3B+ that has the bootfs on a 2.0Gb SD card and the rest of the system on a 40Gb IDE HDD on a USB2.0 controller.

Works just fine (for the moment and only on SSH) and won't know how my coffee roasting software will do till I receive a presently stuck-in-the-mail HDMI-VGA adaptor for the 15" LCD screen I will use.

The previous HDD I used went south after a short stint as a RPi HDD and I was wondering if the way the RPi shuts down had anything to do with it.
ie: when I do sudo shutdown -h now, I notice that power to the HDD is cut out within three maybe four seconds but the amber LED on the board keeps flashing for another five to seven seconds.

Now, I would not have noticed this sequence had it not been for the short high pitched screech/whine of the drive coming to a halt.

I used these drives quite a bit to make backups and move image files between MS systems (mostly W98, NT4,W2000) and don't recall (it was long ago) that drive whine on disconnect, but maybe I've just forgotten. (?)   

It won't much be of a problem if yet another resucitated HDD gives up the ghost but I'd hate that it were for something that could be avoided.
eg: spin down the drive before cutting off power to the USB port instead of directly cutting off power to the USB port?

I say this because I think the RPi was not designed to work with HDDs and I have the idea that the HDD is being handled like a SD card.

But then I don't think SD cards were designed for HDD duty but to be used in cameras and similar equipment where files are large and usually stay put to be read multiple times once generated, so it would seem that the RPi / SD card match is not a good one either.

Any ideas on how to do this?

Thanks in advance,

A.

Last edited by Altoid (2020-05-05 23:13:07)

Offline

#2 2020-05-07 17:48:46

Camtaf
Member
Registered: 2019-11-19
Posts: 408  

Re: Raspberry Pi 3B+ and USB HDD shutdown

If you aren't using GUI software to shutdown your RPi, use halt -p, that should close files & unmount before cutting the power to both HDD & Rpi.

I've used pendrives, SSD, & HDD externally to boot from, (the HDD needed its own power supply).

Using a microSDHC card to boot from plus a HDD as / should be no problem, I do it.

You can also use the microSDHC card to boot & hold the O/S, while using the external HDD as your /home.

Last edited by Camtaf (2020-05-07 17:49:11)

Offline

#3 2020-05-07 18:17:52

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Re: Raspberry Pi 3B+ and USB HDD shutdown

Hello:

Camtaf wrote:

... use halt -p, that should close files & unmount before ...

Like I mentioned I use sudo shutdown -h now.
If I do sudo halt -p it will have (it has) the same effect I describe in my OP (as far as I know) as they are mostly the same.

ie: shutdown -h = shutdown --halt

Camtaf wrote:

... microSDHC card to boot from plus a HDD as / ...

Yes, that is exactly what I am doing.

... has the bootfs on a 2.0Gb SD card and the rest of the system on a 40Gb IDE HDD ...

Thanks a lot for your input.

Cheers,

A.

Offline

#4 2020-05-15 18:34:47

ShorTie
Member
Registered: 2020-05-14
Posts: 21  

Re: Raspberry Pi 3B+ and USB HDD shutdown

" (the HDD needed its own power supply)."

That is the best idea imho
Provide the hard drive power.
Pi's cut usb power, long before the green light blinks 10 times.
Saying it's safe to power off.

Offline

#5 2020-05-15 19:52:49

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Re: Raspberry Pi 3B+ and USB HDD shutdown

Hello:

ShorTie wrote:

... best idea ...

Quite so ...

As you may have read, originally I started powering the HDD from one of the RPi's USB ports.
There was a problem with the SDD not spinning up but it was nothing other than the usual in these cases: the length and gauge of the cable with the micro-USB plug.

I wonder how they say too long / too thin in Chinese?   8^7

So I just got rid of it through some light PS surgery and replaced it with nothing.
The PS has three comfortable USB charging ports on the back and are enough.

Done that, I started powering the RPi with shorter and much better quality power only usb cable (Blackberry phone, I think) from one of the USB ports.
Voltage measurements taken at idle read 5.14V which would seem to be correct.

ShorTie wrote:

Pi's cut usb power, long before ...

I also thought as much.
So I switched to powering the HDD from one of the PS's USB ports.

Not being under RPi control, the HDD's shut down timing/scheme would be different.
ie: not as sudden.

Well ...
Turns out that the HDD's shutdown is exactly the same whether the HDD is powered from a USB port on the RPi or a USB port on a separate power supply.
A separate power supply that is not switched off when the RPi is shut down.

Whatever controls this HDD shutdown is within the Devuan image's configuration and evidently does it under the assumption that it is controlling a SD Card and not a HDD.
But I have not been able to figure out what/where it is.

I say this because I have observed that this same HDD does not shut down in the same manner when connected to my Asus 1000HE netbook.

Thanks for your input.

Cheers,

A.

Offline

Board footer