Auto Mount the 2nd HDD

I have another physical HDD on my balenaOS device.

What do I have to do to mount it automatically when the device is rebooted?


Are you connecting your HDD using a USB?
Tomas from the Balena community has a nice set of examples in this repo on how to go about using udev for things like this - GitHub - tmigone/balena-udev-examples: Sample project to showcase udev handling in balenaOS.

Hi, mate.
No, normal HDD and I just want to mount it automatically to use in my containers.

Hi, can you please share more details about your device and how you plan on connecting the HDD to the device ? Is this a x86 workstation with SATA or PCIE ports? The URL Anuj shared above would be helpful to tweak around udev rules and access the drives.

Hey, have you tried just adding an entry in the /etc/fstab on your container applications that identifies the drive by UUID or label? That should be enough to mount it when your application starts.

Hi, @alexgg
Thanks for your reply!

The problem is that we don’t know the exact UUID/label of the drive at building time.
We have to “automatically” mount it…
Tried udev, but no luck…