[SOLVED] Mount USB drive in Hassio to be used on the Media Folder with udev customization

did u got it to work?
i’m also in a x86 and 1st Sata ssd is for the HA system etc, and now i want to get my 2nd sata ssd automaticly get mounted in boot up…

with the above i get USB drives into my local media dir, but no content is showing.

banging my head against the wall for 2 days now…

edit*:
more stupid: it did not mount the usb as above in my post, it makes a new DIR in the media dir named as the usbstick…

how difficult can it be… #$%#$@ zucht…

1 Like

I’m also trying to understand and implement @promithius’s solution, but what is confusing to me is the lack of distinction between a USB stick and a HDD external drive. What made me realize there is a distinction is the last paragraph, where OP mentiones:“You can now unplug the USB stick and insert your drive”. With this in mind, I’m also confused with the two rules version, as there are 3 storages involved: the SD card where the OS boots from, the USB stick in this post and the HDD External Drive what I’m looking to actually mount for media.

Can someone clarify all this? Maybe @promithius?

Did you remove your USB drive that has the udev folder and rules file? I suspect, the file is being overwritten everytime you boot with the USDB drive with udev file/folder.

1 Like

I tried it, but no additional folder in media sources.



Do I have to create a partiton on the USB HDD? HDD is ntfs formated under Windows.

You should use ext4 @FlyByWire

According to this instruction, it does not work for me and in HAOS core-2022.12.3 there is no Supervisor → System, and there in the box Host System, click on the kebab menu and there click on “Import from USB". I do the import via the ha os import console. Are you currently running core-2022.12.3 and supervisor-2022.11.2?

I only managed to do this, but I can’t get the USB flash drives to start automatically

First - THANK YOU for documenting this so thoroughly. I’m running HA on a thin client PC on an internal SSD, and wanted to add an external USB drive for storing dashcam video (download triggered by an HA automation).

Following these instructions, I was able to get a 1TB external drive attached and visible within my media folder inside HA. Upon seeing how easy it was, I decided to use a bigger external drive. I swapped an 8TB drive in place of the original 1TB.

The 8TB was recognized right away and mounted, and I’m able to write files to it. The problem is, HA doesn’t know that it’s a much bigger drive. It’s still being seen as a 1TB drive by running “df -h”.

I’ve Googled my brains out, but I can’t figure out how to make HA (or Linux perhaps) see this as an 8TB drive instead of the original 1TB drive.

Can anyone help?

Hi,

Which rule did you use as I got the same setup as you, but I can’t get it to work.

Did you change anything on the rule?

Did you formatted your drive as NTFS? You might want to try FAT?

There’s some more info on nfts over here: udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory · GitHub

Thx,

Pim

I used the second version, and made no changes.
Both drives, the original 1TB, and the new 8TB, are formatted as NTFS. That doesn’t seem to be a problem. The problem is that the volumes reported by “df -h” reflect the size of the original 1TB drive. When I unplugged the 1TB drive and plugged in the 8TB drive, that additional space isn’t reflected anywhere.

I figured it out. Turns out, NEITHER external drive actually got mounted. A folder was created under /media for each of the external drives when I plugged them in, but neither drive was actually mounted to the relevant folder.

I manually mounted the 8TB drive to its folder, and now I’m seeing the additional space reported, and can read/write files there.

  • did you label the drive?
  • after unplugging the 1tb and plugging in the 8tb it won’t reflect the space until haos is rebooted

You shouldn’t need to manually mount the drive. But if you change drives or add new, you will need to reboot to see the space reflected.

Both drives were labelled, and the folder that was created under media for each of them matched the labels accordingly. I rebooted the PC multiple times before/during/after the drive additions and removals, had no effect.

Manually mounting to the folder under /media has solved my problem, I’m good to go now.

Hello. I recently purchased a Beelink U50 Pro mini pc similar from this review. There is an optional 2.5 in ssd/hdd I can add via sata3. Will this setup work or does it have to be plug in to a usb port??

Hi @tracymckibben , i have the same problem you had with the udev method. What command do you use tu mount your drive ? Is your external drive NTFS ? Is it persistant on reboot or you have to mount it back every time ?

I have tried the following via ssh user@pwd 22222:

/usr/bin/mkdir -p /mnt/data/supervisor/media/MYDIRECTORY (this works OK and it create the directory

/usr/bin/systemd-mount --no-block --automount=no --collect /dev/sdb1 /mnt/data/supervisor/media/MYDIRECTORY

The systemd-mount command shows the following : Started unit mnt-data-supervisor-media-MYDIRECTORY.mount for mount point: /mnt/data/supervisor/media/MYDIRECTORY BUT the lsblk command show the drive with no mount point

I also tried the -t ntsf option but I have the same result

thanks for your help

@goldriver - did you find a solution? I have the exact same issue here - I can get usb sticks to mount, but not an ntfs hdd (I haven’t got the usb sticks mounting automatically through udev rules - but not trouble shooting that, because I can’t get usb ntfs hdd to mount).

1 Like

how to create switch.mountusb?

I followed the instructions here and managed to mount NTFS drives:

1 Like

I already tried that method but in HAOS NTFS is NOT an option, I have been able to mount all FAT and ext4 formatted drive but ANY ntfs are not mounting as they are not recocnised as a type by the mount command

check my previous post, I was able to mount NTFS drives using the instructions from that video. Basically, you need real root access before you can mount anything.

I made all test from root access but when trying to mount the drive, there is always a message saying that MOUNT doesn’t have NTFS drivers.

Wondering, what is your installation, HASSOS, Container,Supervised or Core ?