Where do I find my external hdd? Hassio knows it is there but


#1

I have attached a Fantom 2 TB drive to my RPi3 running Hassio. When I click on the “hardware” button on the system tab of the hassio pane, it shows 2 drives /dev/sda1 and /dev/sda

When I did the update this morning, the drive spun up and if I click the ‘import from usb’ the drive also spins up. So Hassio knows it is there. I want to use the drive to store still images for a timelapse. I can’t seem to find any way to access it.

I have read the posts advising to add it via devices:, but that doesn’t work with Hassio. I have read the post that tells how to get to the os in developer mode, but that seems to be strongly discouraged.

Am I missing something?


#2

That is only 1 drive.

/dev/sda is the drive, /dev/sda1 is the partition


#3

As far as I know that’s not possible with a Hassio (ResinOS) installation. The replacement for it, HassOS plans on adding that sometime in the future (if I understand correctly): https://github.com/home-assistant/hassos/issues/89


#4

Hi!

It is possible to access the drives, however it is not trivial.
Mind if I ask how you are planning to access it?
I can try to explain but I want to understand the protocol (FTP? Terminal access? Samba?)

B


#5

I need to store a fairly large number of photographs for around 24 hours. I want to have a camera on the end of my harvesting robot arm to take pictures of each plant at 10 minute intervals. I have 300 head of lettuce on each wall but that will grow to around 600. I am going to use machine vision to inspect each plant for deficiencies in water/nutrients/light. Then the photographs will be assembled into a timelapse video of the plant’s growth.

I was going to use a Pi Zero with a Picam to take the photos and then route them via MQTT to the RPi3 running Hassio. The USB HDD is attached to the RPi3. I have tried using cp to just transfer the files directly, but kept running into file permission problems.

I can’t seem to get a SAMBA share to work either. Transferring them to a computer on my network is an option but I would prefer a self contained solution.

I don’t really have a preference for how it is done, just get it done reliably. The traffic volume is fairly low so speed is not really an issue. The MQTT broker is already handling the data from the temperature, humidity, and CO2 sensors.


#6

@flamingm0e
Ok, got it.
Why is the drive spinning up then?


#7

Because it has power? Because the system is scanning for devices?
:man_shrugging:

I don’t know. I don’t use hassio because of the many limitations it has.


#8

You may have something there, if the system does a port scan, then the HDD may just be doing a spin-up anticipating a data request.


#9

Hi! I just realized that I did not post the reply last time :frowning: sorry…Here you go!

Hi! First of all wow, this is a very impressive project!
Judging from the description I would assume that you know the basics of Linux and Hass.IO as well and you would also be able to use simple git operations. Let me know if you need details in these topics and I will explain more.

So the drive is accessed by the Linux system running on your pi, that is why the drive spins up. Hass.IO add-ons can access the drives if they are explicitly asking for it. This is the good news part.
The bad news are that most add-ons will not do this because most people are probably not using external hard drives with their home assistant installs.

So the way you have to handle this is the following:

  1. fork the samba add-on into your GitHub account: https://github.com/home-assistant/hassio-addons/tree/master/samba
  2. change the config.json file of your fork and add your HDD to the devices section: “devices”: ["/dev/sda1:/dev/sda1:rwm"] (for an example look here:
    https://github.com/bboti86/addon-torrdlna/blob/master/torrdlna/config.json)
  3. add the privileged section as well from the example above, the hass.io system will need this to access the drive
  4. create the /share/mnt directory and mount the filesystem for this we will use

Putting it all together I realized that this is quite complicated. Let me know if you understand what I’ve wrote.
I actually started to create the fork I’ve mentioned above but got quite busy :frowning:
I’ll try to work it out for you maybe in the near future however I can’t guarantee anytime soon. I’d suggest you to contact @frenck, who makes all these amazin community addons for hass.io, maybe he has something on his roadmap that supports accesing hard drives connected. Frenck, can you help us out here?

Thanks!
Botond


#10

Hey there, IM looking for this solution but I’m not sure about step 4.
what exactly do I need to do, and where?

Best Wonkavator


#11

You need to use the terminal or SSH add-on. Log into the computer running HassOS and there create the directory and mount the drive, see this for some hints: https://youtu.be/PWo1xkE0sds


#12

Hm i see, so everytime HassIO is restarting I need to mount it manually?


#13

You can set up the add-on to run the mount commands every time it starts


#14

@bboti86 Thank you for the steps, i am stuck in identifying the correct partition of my external hard disk.

Shows up as sda: sda2 < sda5 >
My config.json has been mod to /dev/sda1:/dev/sda1:rwm

Please guide in setting this up :slight_smile:


#15

Hey,
Run lsblk
That is the best tool for finding the partition.
B


#16

I am currently on running on hassos and the command is not supported :frowning:
image


#17

I believe that you can just go to hass.io -> system -> hardware and you should see your drive there


#18

Hi, first of all, thanks for your help and sorry for my English.
I try to mount my HDD following your instructions and when I’ve done the point 4 in SSH I’ve obtained this error “mount: mounting /dev/sda1 on /share/mnt failed: No such file or directory”
I see the drive in hass.io -> system -> hardware
I create the addon for SAMBA modifying the file config.jason with

  "devices": ["/dev/sda1:/dev/sda1:rwm"],
  "full_access": true,

I try to do this How to mount a USB Thumb Drive (External Storage) in HASSIO? and Add-Ons?
and put in “run.sh” the instruction “mount” .

But, the same result… Can you help me?
Thanks, again


#19

Hi!
Please make sure you check that the directory that you are trying to mount to exists. This error probably indicates that is not the case.
B


#20

try to mount on /mnt not on /share/mnt