Configure nfs server debian 8 jessie servers

Moderators: mdrjr, odroid

Configure nfs server debian 8 jessie servers

Unread postby marcavatar » Sun Oct 08, 2017 11:27 pm

Hi, I was able to install the debian 8 jessie system on my Ordroid XU4, I then installed the NFS network sharing system since I have several hard drives to share, the system only works whenever I need to share a hard disk I need to restart server with the command "systemctl restart nfs-kernel-server" otherwise Client does not see it. Is there a command to start it automatically? Hard Drives I turn them off and tell them when they need them, how can I do this to avoid rebooting the server every time? Thank you.
marcavatar
 
Posts: 44
Joined: Mon Feb 15, 2016 2:24 am
languages_spoken: italian
ODROIDs: Odroid C1+

Re: Configure nfs server debian 8 jessie servers

Unread postby mad_ady » Mon Oct 09, 2017 1:00 am

How do you turn off the disks? Do you mean the go to sleep or do you unplug them? How do you handle mounting? You can also reload nfs with sudo exportfs -ra
You can also tie this to udev rules so it's restarted when a disk comes online. Not sure what happens to existing transfers though...
User avatar
mad_ady
 
Posts: 2582
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Configure nfs server debian 8 jessie servers

Unread postby marcavatar » Mon Oct 09, 2017 6:12 am

Hi, thank you for the answer, the disks mount themselves on the desktop pc at boot but then I have to restart each time the nfs server from the terminal to be able to see them in the client. How do I make a rule for them to see them automatically on the client when hard drives start?
marcavatar
 
Posts: 44
Joined: Mon Feb 15, 2016 2:24 am
languages_spoken: italian
ODROIDs: Odroid C1+

Re: Configure nfs server debian 8 jessie servers

Unread postby mad_ady » Mon Oct 09, 2017 2:45 pm

So - the problem is client-side with stale mountpoints? Meaning your client mounts the nfs share, uses it and after a while the disks are turned off and don't recover when turning them back on?
If yes, I'd recommend using autofs on the client so that the shares are mounted automatically on first use and umounted automatically after a period of idle time.
User avatar
mad_ady
 
Posts: 2582
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Configure nfs server debian 8 jessie servers

Unread postby marcavatar » Tue Oct 10, 2017 2:53 am

Hi, thanks for the answer, is there an understandable tutorial for an amateur to install and configure my hard drives with this autofs? Thank you.
marcavatar
 
Posts: 44
Joined: Mon Feb 15, 2016 2:24 am
languages_spoken: italian
ODROIDs: Odroid C1+

Re: Configure nfs server debian 8 jessie servers

Unread postby marcavatar » Tue Oct 10, 2017 4:58 am

For the sake of precision I use a xu4 odroid with debian installed as a server, I connected hard drives containing multimedia files that I share with a cydode c2 where I installed KODI, when I turn on a hard disk I have no problems with DEBIAN on the desktop and I can open folders, same as other hard disks, but on KODI does not open the folder, I have to restart the NFS system from the terminal with this command: "systemctl restart nfs-kernel-server" at that point opens the folder. I hope there is a specific command to prevent the NFS service from restarting every time
marcavatar
 
Posts: 44
Joined: Mon Feb 15, 2016 2:24 am
languages_spoken: italian
ODROIDs: Odroid C1+

Re: Configure nfs server debian 8 jessie servers

Unread postby mad_ady » Tue Oct 10, 2017 2:22 pm

This will get you started with autofs: https://help.ubuntu.com/community/Autofs
User avatar
mad_ady
 
Posts: 2582
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Configure nfs server debian 8 jessie servers

Unread postby marcavatar » Thu Oct 12, 2017 8:30 pm

Hi, I have installed AUTOFS as recommended by links, but I do not know where to mount my files, first opened the configuration file with this command "nano / etc / exports" and then created a line such as "/ media / root / ElementsP 192.168.178.0/255.255.255.0(rw,no_subtree_check,crossmnt,sync,fsid=0,no_root_squash) "and restarted, this system allowed me to mount the file on a client, but then if I leave the hard disk containing the folder in question and subsequently re-ignited the same did not see me anymore. What do I have to open through a timeline, and what should I write, is the line equal or do I have to write a different command? Thank you.
marcavatar
 
Posts: 44
Joined: Mon Feb 15, 2016 2:24 am
languages_spoken: italian
ODROIDs: Odroid C1+

Re: Configure nfs server debian 8 jessie servers

Unread postby lazlo » Sun Oct 15, 2017 6:34 am

If the nfs exports are not going to be available for some reason you might want to read the nfs and mount manual pages to learn about the timeout and retry settings built into nfs.

You should be able to set the mount points with the desired options in /etc/fstab of the client. That way the directories exported via nfs from the server will always mount in the same place on the client. A word of advice about mount options in fstab: you usually do need a lot of options set.



lazlo
lazlo
 
Posts: 13
Joined: Sun Oct 01, 2017 11:32 am
languages_spoken: english
ODROIDs: XU4


Return to Other OS

Who is online

Users browsing this forum: No registered users and 2 guests