0

I would like to use an old raspberry zero 1.3 to share files in my home network, but I wish I could shut down the connected hard drives as the system shuts down.

Initially I thought that it was enough to associate the status of the ACT led to a GPIO pin ( https://forums.raspberrypi.com/viewtopic.php?t=146455#p964587 ), but in case of errors the led will start flashing, then the disks connected could be damaged.

So, using a mosfet, how can I turn off a usb hub if the system is not booted?

Pinguto
  • 103
  • 2

2 Answers2

1

This is the tasks you need to perform:

  1. you need to unmount the drive
  2. then power off the USB hard drive
  3. shut down the Raspberry Pi OS.

Other ways to achive the funtion you describe will involve a separate MCU and electronics.

MatsK
  • 2,882
  • 3
  • 17
  • 22
1

If you want to shutdown a Pi (regardless of whether it uses SD Card or HD) you should run poweroff which enables a controlled shutdown, flushing buffers etc.
If you do not do this you risk corruption of the FS.

This can be initiated by a GPIO pin using gpio-shutdown.
Run run dtoverlay -h gpio-shutdown for description.

There is NO reliable way of detecting if the Pi is running although there are visual indicators. Any of the various "solutions" for this are unreliable!

See What happens to the GPIO voltage after shutdown?

There is a gpio-poweroff which is intended to control power circuitry BUT you MUST provide circuitry to remove power if you use this.

Milliways
  • 62,573
  • 32
  • 113
  • 225