-
Notifications
You must be signed in to change notification settings - Fork 206
[WIP] Add docs on mounting NFS share via systemd #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
For context: This pull request originated in an issue about how configuring an nfs mount would break networking after a reboot. |
|
It sounds like fstab breaks things, so we should remove it.
|
6069458 to
c97bde1
Compare
|
Okay, I replaced the fstab section with one on systemd mount units. Have a look let me know what you think. |
dlech
left a comment
There was a problem hiding this 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! |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudo
|
Thanks for the feedback. I made the changes you requested. |
also added a sentence about hanging during boot.
|
Merged, thanks! |
|
You're welcome! Thanks for ev3dev. :) |
Hey, two quick questions:
machines.targettarget for the mount unit file. I don't think that makes much sense for ev3dev. In my setup, I simply usermulti-user.target. I'm not familiar with the ev3dev boot process though. Any other target you would prefer?