If your tftp server is set up to serve from /tftpboot as suggested above your EA board now loads on your local network directly from the development host.

If your tftp server is set up to serve from /tftpboot as suggested above your EA board now loads on your local network directly from the development host.

+

+

You can put the IP address for bren.hih.au.dk in your local /etc/hosts file.

+

+

==Automounting SSHFS==

+

+

Automount is a smart feature in Linux. It will allow you to access remote filesystems at any location provided you got a network connection to that system. Sshfs is one such filesystem automount can handle.

+

+

Automount will prepare for mounting the remote filesystem, but not perform the actual mount until the remote filesystem is accessed. Automount just sit quiet and wait for you to access the remote system and will in a matter of one or two seconds mount the remote filesystem making it accessible to you. When there is no activity for a period of time the remote filesystem is unmounted again - thereby minimising the network traffic.

+

+

In order to have sshfs's automounted follow these instructions:

+

+

As root

+

+

<source lang="bash">

+

$ yum install autofs

+

$ groupadd fuse

+

$ usermod -a -G fuse <your-loginname>

+

</source>

+

+

Ensure that you have access to login on the remote server over ssh.

+

+

<source lang="bash">

+

$ ssh <your-loginname>@<remote-host>

+

</source>

+

+

If you were prompted for the password create and distribute a public key as described in the section above. Next:

+

+

<source lang="bash">

+

$ ssh-copy-id -i ~/.ssh/rsa_id.pub <your-loginname>@<remote-host>

+

</source>

+

+

Re-test that you can login.

+

+

Next grep in /etc/passwd for your loginname

+

<source lang="bash">

+

$ grep /etc/passwd <your-loginname>

+

<your-loginname>:x:500:500:Yourname:....

+

</source>

+

+

This indicates that your uid and gid is 500 or whatever you read on your *nix.

The timeout can be varied - in this example I have set it rather long, because for example my texteditors usually autosaves every 5 minutes = 300s. If the automount timeout were shorter than this the directory is automagically unmounted and the text editor has to wait for a remount.

+

+

Now create /etc/auto.bren.sshfs and auto.merlin.sshfs and add one line per remote share you want to mount.

'''Note''': The #klausk... is not a comment and shall be included. And of course you shall change the directories and login names to suit your needs.

+

+

'''m''' can be anything, e.g. '''au-herning''', '''sunshine''' or just '''m''' to make it short. The ~/sshfs/au-herning directory will be created when automount starts. The '''m''' directory is mounted when the au-herning is accessed. Below '''m''' is the structure of your remote server.

+

+

Now create the root for the automount to work on.

+

+

Logged in as your self issue:

+

+

<source lang="bash">

+

$ mkdir -p ~/mounts/sshfs

+

</source>

+

+

The sub-directories on the sshfs directory will be created by automount.

+

+

Finally start the automount program in debug mode as root:

+

+

<source lang="bash">

+

$ automount -f -v

+

</source>

+

+

observe that the are no errors. Try to access your remote server through the mount, observe that you can access the files and that there are no errors.

+

+

Kill the program by Ctrl+C

+

+

Activate automount such it will start at boot.

+

+

<source lang="bash">

+

$ systemctl enable autofs.service

+

$ # and start it

+

$ systemctl start autofs.service

+

</source>

+

+

Reboot your computer and ensure that the automounting is working correct. Logged in as your ordinary username, issue:

+

+

<source lang="bash">

+

$ ls mounts/sshmount/au-herning

+

# some output here after a few seconds

+

</source>

Latest revision as of 13:38, 1 August 2013

SSHFS is a filesystem, that works over a SSH tunnel.

sshfs is very useful for mounting remote shares as an ordinary user. sshfs does not require exports on the sharing host. sshfs does not require to become super user to mount.

In order to mount a remote file system locally follow these instructions:

and your EA board can boot directly from your development host, provided you install a tftp server on your local machine and let it share from /tftpboot. Remember to set up the EA board to work in your local network.

Step-by-step

First follow the instructions above and mount the disk on your development host on a directory in your home directory.

The uid and gid's mentioned below may vary on your computer. Check locally in /etc/passwd and /etc/group your uid and gid.

local host$ sshfs -ouid=500-ogid=500-p22<your login on bren>@bren.hih.au.dk:<your mounted disk from the development host><mountpoint>local host$ ln-s<mountpoint>/<path-to-uClinux-dist>/images /tftpboot

If your tftp server is set up to serve from /tftpboot as suggested above your EA board now loads on your local network directly from the development host.

You can put the IP address for bren.hih.au.dk in your local /etc/hosts file.

Automounting SSHFS

Automount is a smart feature in Linux. It will allow you to access remote filesystems at any location provided you got a network connection to that system. Sshfs is one such filesystem automount can handle.

Automount will prepare for mounting the remote filesystem, but not perform the actual mount until the remote filesystem is accessed. Automount just sit quiet and wait for you to access the remote system and will in a matter of one or two seconds mount the remote filesystem making it accessible to you. When there is no activity for a period of time the remote filesystem is unmounted again - thereby minimising the network traffic.

The timeout can be varied - in this example I have set it rather long, because for example my texteditors usually autosaves every 5 minutes = 300s. If the automount timeout were shorter than this the directory is automagically unmounted and the text editor has to wait for a remount.

Now create /etc/auto.bren.sshfs and auto.merlin.sshfs and add one line per remote share you want to mount.

Note: The #klausk... is not a comment and shall be included. And of course you shall change the directories and login names to suit your needs.

m can be anything, e.g. au-herning, sunshine or just m to make it short. The ~/sshfs/au-herning directory will be created when automount starts. The m directory is mounted when the au-herning is accessed. Below m is the structure of your remote server.

Now create the root for the automount to work on.

Logged in as your self issue:

$ mkdir-p ~/mounts/sshfs

The sub-directories on the sshfs directory will be created by automount.

Finally start the automount program in debug mode as root:

$ automount -f-v

observe that the are no errors. Try to access your remote server through the mount, observe that you can access the files and that there are no errors.