01-07-2021 05:21 AM
Hello Everybody,
at the moment I am struggeling with the following problem: Mount a Windows shared folder in my sbRIO 9637(Linux RT) after a reboot automatically.
Background:
The sbRIO should run in a embedded standalone application and save .csv logging files from time to time in a network drive. After reading here some helpful threads, iam able to mount a Windows shared folder in the sbRIO directory /home/lvuser/data.
Therefore I used PuTTY and the command line:
mount -t cifs //192.168.XXX.XX/Share - o username='Simon...',pasword='xy',uid=lvuser /home/lvuser/data
I works well but after a reboot the folder is not accessible and I have to write the command again with PuTTY. But actually this ist not a suitable solution for my task. After every reboot the folder should be mounted automatically.
Has anyone an idea how to solve this problem? I would be glad to receive some ideas or tips:)
Thank you in advance!
Best regards
Simon
Solved! Go to Solution.
01-07-2021 07:53 AM - edited 01-07-2021 07:55 AM
Hi Simon,
to automatically mount a network share is not so easy because of the order the system starts its services and the user rights for mounting. But it's possible and it's working reliable. Some time ago I wrote a comprehensive guide in our public DokuWiki. Here is the link: https://dokuwiki.hampel-soft.com/kb/ni-rt/linuxrt/samba
Regards
Manu
01-07-2021 03:32 PM
Hi Manu,
thank you for your fast reply and the interesting link. I read your instruction and it describes exactly what I need.
But unfortunaltIy iam a complete beginner in Linux and have a few questions about your instructions.
The execution of the "mount" directly from Labview would be my favorite solution. You write here:
"Mounting as lvuser
lvuser is the standard account for running all LabVIEW programs. Because this user has no root privileges it can not mount a network share without further configuration. First, a line in the file /etc/fstab like above is needed and this line must have the option users to allow any user to mount and unmount a file system."
But how can I configure a line in the file /etc/fstab?
At the moment I don't see any folder fstab under /etc at all... at least in the folder structure of my sbRIO (s. sbRIO.png).
In another post I read you also have to check the write permissions of /etc/fstab (ls -l /etc/fstab). I did that with the result that admin has read and write permissions.
Maybe the call from my system Exec.vi is wrong?
How should that look right?
Would be great if you could help me in this point further.
Best regards
Simon
01-08-2021 08:36 AM
Hi Simon,
I'm happy to read that my DokuWiki article helped you.
Regarding the "/etc/fstab": this not a folder, it is a text file without a type-extension. It exists on any Linux systems. You can open it with any text editor. Usually, to acess the filesystem on a LinuxRT remote system I use the Window program "WinSCP" (connection via SFTP) and then open text files with "Notepad++". An alternative way is to connect to LinuxRT directly via SSH (Putty, Git-Bash or the in newer Windows versions integrated SSH-client in CMD or PowerShell) and edit the file with the command "vi" (google the usage) or "nano" (easier to use, but you have to install it on LinuxRT).
When you have edited the "/etc/fstab" don't forget to set the "SUID-Bit" for the mount-program so that the user "lvuser" can execute it. On the LinuxRT system, execute (via SSH) the following command:
chmod +s /sbin/mount.cifs
Now you can execute the mount command from the LabVIEW Exec-Node. The command should look like "mount /mnt/my_mount_folder_from_fstab".
Hope you get it working now 🙂
Manu