Skip to content

Conversation

@JesApp
Copy link
Contributor

@JesApp JesApp commented Nov 17, 2017

Hey, two quick questions:

  1. Should I leave in the old section on mounting an NFS share via fstab, or should I remove it?
  2. The original tutorial used the machines.target target for the mount unit file. I don't think that makes much sense for ev3dev. In my setup, I simply user multi-user.target. I'm not familiar with the ev3dev boot process though. Any other target you would prefer?

@JesApp
Copy link
Contributor Author

JesApp commented Nov 17, 2017

For context: This pull request originated in an issue about how configuring an nfs mount would break networking after a reboot.

@dlech
Copy link
Member

dlech commented Nov 17, 2017

It sounds like fstab breaks things, so we should remove it.

multi-user.target sounds fine.

@JesApp
Copy link
Contributor Author

JesApp commented Nov 18, 2017

Okay, I replaced the fstab section with one on systemd mount units. Have a look let me know what you think.

Copy link
Member

@dlech dlech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very nice. Thanks.

The usual way of running things as root on ev3dev is to use sudo, so I would like to add that to all of the commands. And I made a few other suggestions.


Next you'll need to update a file (as root) called `/etc/fstab`. You should have already set up USB Networking, so `ssh` to the EV3 and run an editor like `vi` or `nano` to edit the file. Here's the line you want to add to `/etc/fstab` - DO NOT TOUCH ANYTHING ELSE IN THERE!

On the client - ev3dev - side, we need to create a system mount unit in order to mount our newly created NFS share. **Note**: The classic way of mounting the NFS share via an entry in /etc/fstab does not work!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"system mount unit"

Could be more clear if you say "systemd .mount file". I suspect that the term "unit file" is probably not familiar to most people.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to have a note about fstab. We can make it stand out even more with some special formatting.

{% include /style/icon.html type="warning" %}
The classic way of mounting the NFS share via an entry in /etc/fstab does not work!
{: .alert .alert-warning}


# For the Linux example, it would look like:
192.168.2.1:/home/hostuserid/nfs/ev3dev /home/robot/nfs/linux nfs users,noauto,rw,vers=3 0 0
modprobe nfs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be run a root:

sudo modprobe nfs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I am wondering if this needs to be done at all. Did you try without loading the module first to see if it is automatically loaded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, this is done automatically. I'll remove the entire section.


# For the Windows Hanewin example, it would look like:
192.168.0.199:\E\Users\James\Dropbox\ev3dev /home/robot/nfs/windows nfs users,noauto,rw,vers=3 0 0
echo NFS >> /etc/modules
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be run as root. (or possibly could be omitted like I said above)

sudo sh -c 'echo nfs >> /etc/modules'

In order to mount the NFS share, you first need to reload the systemd daemon:

Once you've updated the `/etc/fstab` file, you will need to create the mount points. Since I test `ev3dev` o n all three major platforms, I have separate directories for each nfs host. You probably only need to create one of these, but this script creates all three for me:
systemctl daemon-reload
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to run as root. sudo ...

mkdir -p ~/nfs/linux
mkdir -p ~/nfs/windows
mkdir -p ~/nfs/osx
systemctl start home-robot-nfsshare.mount
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo

mount ~/nfs/linux

...or whichever of the above three directories you want to mount.
systemctl enable home-robot-nfsshare.mount
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo

@JesApp
Copy link
Contributor Author

JesApp commented Nov 19, 2017

Thanks for the feedback. I made the changes you requested.

also added a sentence about hanging during boot.
@dlech dlech merged commit d00c661 into ev3dev:master Nov 19, 2017
@dlech
Copy link
Member

dlech commented Nov 19, 2017

Merged, thanks!

@JesApp JesApp deleted the nfs-via-systemd branch November 19, 2017 17:32
@JesApp
Copy link
Contributor Author

JesApp commented Nov 19, 2017

You're welcome! Thanks for ev3dev. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants