Skip to content

feat(pi): unmount external USB on undervoltage and I/O errors - #2150

Open
LuckyCoders wants to merge 3 commits into
getumbrel:masterfrom
LuckyCoders:feat/pi-external-storage-power-monitor
Open

feat(pi): unmount external USB on undervoltage and I/O errors#2150
LuckyCoders wants to merge 3 commits into
getumbrel:masterfrom
LuckyCoders:feat/pi-external-storage-power-monitor

Conversation

@LuckyCoders

Copy link
Copy Markdown

Summary

When external USB storage is mounted on Raspberry Pi under Files → External, power-related failures (board undervoltage, kernel warnings, storage I/O errors) can corrupt data if writes continue.

This PR adds a background monitor that detects those conditions and safely unmounts external drives, then notifies the user to use a powered USB hub or a drive with its own power supply.

Depends on:

Problem

Raspberry Pi USB ports supply limited current. Large HDDs without external power often cause:

  • Yellow lightning bolt / Under-voltage detected! in kernel logs
  • vcgencmd get_throttled undervoltage flags
  • USB disconnects and I/O error on sdX

Umbrel had no Pi-specific handling: drives could stay mounted while the system was unstable.

Changes

New: external-storage-power-monitor.ts

  • Runs only on Raspberry Pi while external storage module is active
  • Polls every 15 seconds when at least one drive is mounted under /External
  • Detects:
    • vcgencmd get_throttled — undervoltage now or since boot (0x1, 0x10000)
    • Kernel log:

LuckyCoders and others added 3 commits May 18, 2026 18:37
The Pi external storage mount script silently ran wipefs and mkfs.ext4
when a single USB disk was not recognised as an Umbrel data drive.
Require explicit opt-in before formatting and block foreign filesystems.

Fixes getumbrel#1956

Co-authored-by: Cursor <cursoragent@cursor.com>
Skip the Pi boot data-disk script unless umbrel-allow-external-format is set.
Enable umbreld external storage on Raspberry Pi, install ntfs-3g on arm64, and
exclude disks already used as the Umbrel data volume at /mnt/data.

Depends on fix/pi-refuse-auto-format-external-usb

Co-authored-by: Cursor <cursoragent@cursor.com>
Poll vcgencmd throttled state and kernel under-voltage / I/O error logs
while external storage is mounted on Raspberry Pi. Automatically unmount
affected drives and notify the user to use powered USB.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant