Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot see mounted HDD in Raspberry PI 4

Solved!
Go to solution

I have a raspberry pi 4 with labview 2020 proffessional successully installed.

To see if it is running correctly I run the example which switches the LED which is working fine.

 

I did some code to read folders (using simply the "List Folder" function from LabVIEW) as well as read and write ascii file.

All this works very well and as I expected.

 

Ok, now I mounted an external HDD, expecting to be able to use. But somehow it is not visible to the "List Folder" function I use in my code.

I can navigate through the folders up to the mount point and it is just missing..

 

Mind, I can see the mounted device via VNC on the RasPi. I can copy files and all. So I do know it is there.

Just from the deployed VI this monted device is invisible.

 

Any clue how to make a mounted HDD acessible through the "List Folder" function?

Thanks in advance...

 

0 Kudos
Message 1 of 8
(4,593 Views)

I am not sure how to deal with this but I bet the reason you don't see it is because LabVIEW is installed in a separate chroot.  The fact that you can see the hard drive from the Raspberry Pi OS does not mean it is available to the LabVIEW chroot.  I would look into how to make the hard drive available to a chroot and maybe that will help you.

David Wilt
The New Standard LLC
Message 2 of 8
(4,582 Views)

I have already found the folder

/srv/chroot/labview

which seems to be the chroot folder as I found in one comment in the net.

So I tried to mount the HDD to

/srv/chroot/labview/mnt/hdd

Just it still didn't appear using the "List Folder" funktion, though.

 

So there may be something else I am missing.

 

I also have to admit not to be exactly THE linux expert 😉

(quite to the cortrary...)

0 Kudos
Message 3 of 8
(4,574 Views)

David is right. The LabVIEW system runs in its own schroot environment, which is basically a lightweight VM system for Linux. The "root" of said VM system is located inside a subdirectory of the host system and unless there is a specific mapping in the configuration file for the specific chroot environment, any process running inside the chroot has absolutely NO access to anything outside that root path!

 

That configuration makes for instance parts of the /dev/.. filesystem accessible to the chroot environment at the local /dev/... tree.

 

Some further explanation about this and a trick to access the host resources from the chroot environment over SSH: https://www.instructables.com/LabVIEW-Raspberry-Pi-SSH-Trick/

 

But it's also possible to add according file mappings to the labview chroot configuration script that is used to startup the chroot environment so that host system paths can be remapped to a path inside the chroot. Trying to mount host paths to the chroot can't work as the host path simply is not accessible inside the chroot unless it is specifically mapped as chroot alias during initialization of the chroot environment. Otherwise an important aspect of using chroot would be pretty much moot. The system is meant to isolate as much as possible whatever is running inside the chroot from the actual host system so that even rogue software could not harm the host system. NI doesn't really use it for this but in order to be able to install a Linux environment that is binary compatible to a single LabVIEW for ARM runtime system, without having to create a new LabVIEW for ARM runtime environment for every new Raspbian and BBB OS version.

 

Rolf Kalbermatter
My Blog
Message 4 of 8
(4,570 Views)

Hi I had this same problem some time ago. I found some step by step instruction on how to mount the external hdd to raspi OS after start of the OS.

Then I followed the same procedure inside of the chroot environment and added a system exec.vi with mount -a command to my labview software and finally I was able to see the external drive inside of the chroot.

 

Unfortunately I don't remember exactly which instruction on what website I was following. 

Message 5 of 8
(4,547 Views)

Rolf,

thank you  so far for your suggestion.

I followed the "SSH-Trick" descrition and tried "ssh pi@localhost ls -a /mnt/SSD" whicht actually worked.

 

Yet this doesen't help with the implemented "List Folder" function.

 

Still got some insights, though.

0 Kudos
Message 6 of 8
(4,535 Views)

This was not meant to solve your problem but give you an idea how the chroot file system is located inside the host file system. The host can access actual paths inside the chroot (but won’t see virtual paths that are mounted on startup of the chroot). The chroot environment can’t see paths outside of its own root at all unless they are mapped during startup to local paths.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 8
(4,508 Views)
Solution
Accepted by topic author Wolfram_Zahnow

Ok, here we are.

Thanks to those leading me to the solution.

It seems fairly simple, after all.

 

Here are the steps to make it happen:

There is one

   /etc/fstab   (of the pi)

and one

   /srv/chroot/labview/etc/fstab   (of the labview chroot)

They both need to contain the mount point like for example:

   LABEL=SSD /mnt/SSD auto defaults,noatime 0 0

 

after reboot of the pi and from within the deployed vi you need to write a plain

   mount -a

to the system exec.vi 

 

Now the "List Folder" function does see the mounted HDD.

Done.

 

Thanks again for those who cared and helped.

 

 

Message 8 of 8
(4,504 Views)