Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 874

HATs and other add-ons • Re: ZERO - Add RW Storage when /boot and / are read only

$
0
0
I'm using a ZERO W. I have a project and would like to set the / and /boot RO for protection in the event of a power failure. However, I need a small amount of disk space for work logs and data.

I first thought I could power the ZERO through the 5V pins and connect a USB flash drive to the USB OTG power. Then I saw a note that you can't power a USB device through the OTG port.

Dunno where you read that but it's incorrect. How do you think USB devices connected to a zero get thier power?

The 5v and ground pins on both micro USB ports and on the GPIO header are directly connected together with no protection of any kind. The data mode is completely unrelated to how the power is flowing.

What you can't do is use the single USB data port as both a gadget (to talk to a USB host) and as a USB host (to talk to a device) at the same time. You need a 4B, 400 or Pi 5 for that (gadget on USB C, host on the USB A ports).
So having never looked into it, can I add a small RW partition to the SD card that I boot from for what I need? I'm asking in case there are any special considerations I need to know about.

Yes. In brief:
  1. Use another Linux computer to reduce the size of the root partition. (because you can't muck about with a partition that's in use and because Windows doesn't know anything about ext4)
  2. Create a new partition in the now free space and format it.
  3. Boot the Pi with the overlay disabled
  4. Create a mount point
  5. Add the third partition to /etc/fstab so it gets mounted on boot (hint: Using fstab A Beginner's Guide)
  6. Re-enable the overlay
  7. Reboot

Statistics: Posted by thagrol — Mon Apr 22, 2024 10:03 pm



Viewing all articles
Browse latest Browse all 874

Trending Articles