Seeking guidance on managing SSD-stored photos via HA

Hello Home Assistant community,
I recently set up Home Assistant Operating System (HAOS) on my Raspberry Pi 4B using an SD card and have been enjoying the experience.
Here’s where I could use some guidance: I have an SSD containing all the cherished photos from my travels, currently sitting idle in a drawer. I’m curious if there’s a way to manage these photos directly from Home Assistant. Here’s my envisioned workflow:

  • Connect the SSD to the Raspberry Pi via USB.
  • Utilize a potential integration to view photos through the HA mobile app or browser.
  • Enable the ability to upload pictures to the SSD from any location using HA Cloud.
  • Share access to specific photos by generating shareable links.

Do you know if something like this is possible to do within HA? And if not, how do you recommend I should approach this?
Thank you!

Thank you for the link, I didn’t find this topic when I used the search function.

I tried the suggested solution, but it doesn’t work for me. I posted a comment in the hope someone there will help me.

I did it just for testing and it worked. But I saw that you used ntfs. I tested with fat 32 and ext4.

Thanks for checking that the procedure still works, somehow it is not working for me.
I didn’t check FAT32 as I will need to store file larger than 4GB, but I tried with EXT4. Still nothing.
Is there anything I can check to verify that everything is proper?

These are the steps I did

1 - Format the pen drive in EXT4 format with the name “CONFIG”
2 - Create a “udev” folder
3 - Copy the file “80-mount-usb-to-media-by-label.rules” to the “udev” folder
4 - Open http://SEUIP:8123/hassio/system/info
5 - In Host, click on the 3 dots and select Import Via USB
6 - Check the log for the messages below:

22-09-08 13:46:38 INFO (MainThread) [supervisor.os.manager] Synchronizing configuration from USB with Home Assistant Operating System.
22-09-08 13:46:38 INFO (MainThread) [supervisor.host.services] Restarting local service hassos-config.service

7 - Remove the pen drive and insert the SSD, formatted in ext4 with the name “ssd” for example
8 - Restart the HA
9 - An “ssd” folder (or the name you used in step 7) should appear inside the media

#
# udev rule
#   Mount USB drive to the media directory using the partition name as mount point
#
# Description:
#   Created for Home Assistant OS, this rule mounts any USB drives
#   into the Hassio media directory (/mnt/data/supervisor/media).
#   When a USB drive is connected to the board, the rule creates one directory
#   per partition under the media directory. The newly created partition is named
#   as the partition name. If the partition does not have a name, then the following
#   name format is used: "usb-{block-name}" where the block name is sd[a-z][0-9].
#
# Note 1:
#   The rule name is always prefixed with a number. In this case, the rule uses 80.
#   This represents the order of the rule when multiple rules exists in udev.
#   Low numbers run first, high numbers run last. However, low numbers do not have all
#   the facilities than high numbers may have.
#   For this rule to run properly, use numbers equal or greater than 80.
#
# Note 2:
#   This rule will skip mounting the 'CONFIG' USB key.
#   https://github.com/home-assistant/operating-system/blob/a6445af71282045c2ea92f1dea8d2f9e518bd008/Documentation/configuration.md
#
# Note 3:
#   This rule will mount the OS partitions if the OS is sorted on a USB drive (i.e. USB booting).
#   To prevent this issue from happening, update the rule to skip the booting USB drive.
#   See the CAUTION message below.
#
# Source of inspiration:
#   https://www.axllent.org/docs/auto-mounting-usb-storage/
#
# Useful links:
#   https://wiki.archlinux.org/index.php/Udev
#
# udev commands:
#   - Restart udev to reload new rules:
#       udevadm control --reload-rules
#   - List device attributes of sdb1:
#       udevadm info --attribute-walk --name=/dev/sdb1
#   - List environment variables of sdb1:
#       udevadm info /dev/sdb1
#   - Trigger add/remove event for sdb1:
#       udevadm trigger --verbose --action=add --sysname-match=sdb1
#       udevadm trigger --verbose --action=remove --sysname-match=sdb1
#


# Filter on block devices, exit otherwise
# CAUTION: Change to 'sd[a-z][0-9]' if booting from a USB drive (e.g.: sda)
KERNEL!="sd[b-z][0-9]", GOTO="abort_rule"

# Skip none USB devices (e.g.: internal SATA drive)
ENV{ID_PATH}!="*-usb-*", GOTO="abort_rule"

# Import the partition info into the environment variables
IMPORT{program}="/usr/sbin/blkid -o udev -p %N"

# Exit if partition is not a filesystem
ENV{ID_FS_USAGE}!="filesystem", GOTO="abort_rule"

# Exit if this is the 'CONFIG' USB key
ENV{ID_FS_LABEL}=="CONFIG", GOTO="abort_rule"

# Get the partition name if present, otherwise create one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usb-%k"

# Determine the mount point
ENV{mount_point}="/mnt/data/supervisor/media/%E{dir_name}"

# If filesystem is ntfs, use the ntfs3 driver, so we get rw support
# Home Assistant Operating System 8.0 or later required (linux kernel 5.15)
ENV{ID_FS_TYPE}=="ntfs", ENV{fstype}="-t ntfs3"
ENV{ID_FS_TYPE}!="ntfs", ENV{fstype}="-t auto"

# Mount the device on 'add' action (a.k.a. plug the USB drive)
ACTION=="add", RUN{program}+="/usr/bin/mkdir -p %E{mount_point}", RUN{program}+="/usr/bin/systemd-mount %E{fstype} --no-block --automount=no --collect $devnode %E{mount_point}"

# Umount the device on 'remove' action (a.k.a unplug or eject the USB drive)
ACTION=="remove", ENV{dir_name}!="", RUN{program}+="/usr/bin/systemd-umount %E{mount_point}", RUN{program}+="/usr/bin/rmdir %E{mount_point}"

# Exit
LABEL="abort_rule"

This is also what I did. The only difference being the pen drive formatted as NTFS, but I got the correct log messages when I loaded the configuration, so that shouldn’t be an issue.
Maybe something in my configuration is not compatible?

  • Raspberry Pi 4B
  • Home Assistant Core: 2024.1.5
  • Home Assistant Operating System: 11.4
  • Home Assistant Supervisor: 2023.12.1

Do you know if there is a way to check which USB devices are connected to the Raspberry?

I could get it to work not following the linked solved issue, but thanks to this:
Mounting Hard Drive to Home Assistant OS - Part 1: Root Access (youtube.com)

I formatted the SSD to EXT4. If you, like me, are using Windows, you can format the SSD to EXT4 using the linux subsystem (WSL2). Follow these steps to get the formatting done:
windows subsystem for linux - Formatting USB SSD on WSL 2 - Unix & Linux Stack Exchange