NFS problems

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
charroo
Level 4
Level 4
Posts: 495
Joined: Mon Aug 14, 2017 9:45 am
Location: ISRAEL!

NFS problems

Post by charroo »

https://community.linuxmint.com/tutorial/view/2009

i've been trying to follow the article above. i ran into some problems...

when i type

Code: Select all

sudo service nfs-kernel-server start
i get:

Code: Select all

Job for nfs-server.service failed because the control process exited with error code. See "systemctl status nfs-server.service" and "journalctl -xe" for details.
why is that?

i'm a total beginner to nfs and mounting filesystems, but i think i configured the mounting right...

this is what i entered in the "/etc/exports":

Code: Select all

/mnt/Music 192.168.0.0(r,async,no_root_squash,subtree_check)
/mnt/Videos 192.168.0.0(r,async,no_root_squash,subtree_check)
i'm trying to connect my desktop computer media to a kodi on a raspberry pi...

what i did wrong?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
i'm on Linux Mint 21.3 Cinnamon
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: NFS problems

Post by rene »

The "r" looks unfamiliar; where did you source it from? According to man 5 exports either "ro" or leave it out altogether.

[EDIT] Talk about red herrings... additionally, you exported the directories to the host 192.168.0.0 whereas you supposedly want to export them to the 192.168.0.x network: use "192.168.0.0/24".
Last edited by rene on Tue Aug 15, 2017 10:32 pm, edited 1 time in total.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: NFS problems

Post by catweazel »

charroo wrote: i get:

Code: Select all

Job for nfs-server.service failed because the control process exited with error code. See "systemctl status nfs-server.service" and "journalctl -xe" for details.
why is that?
Do what it says.

Code: Select all

systemctl status nfs-server.service
journalctl -xe
Also, try starting the service with:

Code: Select all

systemctl start nfs-server.service
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
charroo
Level 4
Level 4
Posts: 495
Joined: Mon Aug 14, 2017 9:45 am
Location: ISRAEL!

Re: NFS problems

Post by charroo »

The "r" looks unfamiliar; where did you source it from?
it was rw. but i assumed that if i just want the data reading option i will need to omit the 'w'.
do you say i have to use rw? what if i just want read and not write?

i will do the change. will let you know of the result.
thanks
i'm on Linux Mint 21.3 Cinnamon
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: NFS problems

Post by rene »

charroo wrote:do you say i have to use rw?
No; the next sentence after the quoted one said "ro" (readonly) or leave it out altogether, as does man exports. Also note that /24 netmask.
charroo
Level 4
Level 4
Posts: 495
Joined: Mon Aug 14, 2017 9:45 am
Location: ISRAEL!

Re: NFS problems

Post by charroo »

thank you
i will change to "ro".


but what about mounting at boot? i've trouble configuring it. can you link me to a guide that explains in a simple way how to boot-mount?
i'm on Linux Mint 21.3 Cinnamon
hcentaur13

Re: NFS problems

Post by hcentaur13 »

The NFS server is the rasberry, not you desctop client. In IP V4 the last digit of the network address can not be 0! That digit is reserved for the network at whole, not a single computer. Beside that 255 is forbidden too.

192.168.0.0 = the network as whole,
192.168.0.255 - special

All other IPs are allowed to be assigned to a single computer
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: NFS problems

Post by rene »

charroo wrote:but what about mounting at boot? i've trouble configuring it. can you link me to a guide that explains in a simple way how to boot-mount?
Rather not. Most "guides" go way overboard and/or provide outdated information. Network filesystem mounts are basically no different from any other type of filesystem; at its most basic you'd add to /etc/fstab the lines

Code: Select all

192.168.0.<x>:/mnt/Music		/mnt/Music	nfs		defaults
192.168.0.<x>:/mnt/Videos		/mnt/Videos	nfs		defaults
in which 192.168.0.<x> is the IP address of your server, the leftmost /mnt/Music and /mnt/Videos its exported directories as per your /etc/exports on the server, the next ones their local mountpoints. Make sure to pre-create them, sudo mkdir /mnt/{Music,Videos}, and feel free to name them whatever you want. Note that you can replace "192.168.0.<x>" by "myserver" if you add a line 192.168.0.<x> myserver to /etc/hosts. Many sources will tell you to add "_netdev" to the options; the type "nfs" as well as any other network filesystem type you are likely to ever encounter in fact already implies "_netdev" when using systemd -- which you do on Mint 18 (but note, systemd, not systemd-networkd; Mint 18 uses NetworkManager, so also ignore advise about enabling systemd-network-wait-online).

This assumes the server to be up and running when the client boots; if it isn't, the client experiences long timeouts trying to mount those filesystems, and it is as such normally advisable to use an automounter for network filesystems. Systemd has one built-in, so again at its most basic:

Code: Select all

192.168.0.<x>:/mnt/Music		/mnt/Music	nfs		noauto,x-systemd.automount
192.168.0.<x>:/mnt/Videos		/mnt/Videos	nfs		noauto,x-systemd.automount
With an automounter the filesystems are conceptually permanently mounted but actually only when in fact accessed. They will specifically not interrupt your boot when something is up (or down...) with server or network. Note that the "autofs" method that many sources will comment on is for an older, separate automounter which is probably not worth investigating any more now that systemd has one built in. If you disagree, I posted a longish comment a while ago: viewtopic.php?f=157&t=225120&p=1188039#p1188104.

Slightly less basic and advised, taken from https://wiki.archlinux.org/index.php/NF ... tc.2Ffstab,

Code: Select all

192.168.0.<x>:/mnt/Music		/mnt/Music	nfs		noauto,x-systemd.automount,x-systemd.device-timeout=10,x-systemd.idle-timeout=1min
192.168.0.<x>:/mnt/Videos		/mnt/Videos	nfs		noauto,x-systemd.automount,x-systemd.device-timeout=10,x-systemd.idle-timeout=1min
Further options (tcp, rsize, wsize, timeo, ...) are available for your perusal pleasure from man nfs but I notice that on 18.2 tcp, rsize=8192 and wsize=8192 are in fact default. Check the output of mount after rebooting and accessing /mnt/Music and /mnt/Videos. That is, this last example should probably be what you use.
charroo
Level 4
Level 4
Posts: 495
Joined: Mon Aug 14, 2017 9:45 am
Location: ISRAEL!

Re: NFS problems

Post by charroo »

it is a long message i will read it later.
i appreciate your help rene
i'm on Linux Mint 21.3 Cinnamon
charroo
Level 4
Level 4
Posts: 495
Joined: Mon Aug 14, 2017 9:45 am
Location: ISRAEL!

Re: NFS problems

Post by charroo »

i've reinstalled mint

but now i get these errors:

Code: Select all

ron@ron-H81M-S2H ~ $ sudo service nfs-kernel-server start
[sudo] password for ron: 
Job for nfs-server.service failed because the control process exited with error code. See "systemctl status nfs-server.service" and "journalctl -xe" for details.
ron@ron-H81M-S2H ~ $ sudo mount /dev/sdb1 /mnt
ron@ron-H81M-S2H ~ $ sudo service nfs-kernel-server start
Job for nfs-server.service failed because the control process exited with error code. See "systemctl status nfs-server.service" and "journalctl -xe" for details.
ron@ron-H81M-S2H ~ $ showmount -e
clnt_create: RPC: Program not registered
ron@ron-H81M-S2H ~ $ sudo apt-get-install nfs-common
sudo: apt-get-install: command not found
ron@ron-H81M-S2H ~ $ 


i'm on Linux Mint 21.3 Cinnamon
altair4
Level 20
Level 20
Posts: 11446
Joined: Tue Feb 03, 2009 10:27 am

Re: NFS problems

Post by altair4 »

charroo wrote: ron@ron-H81M-S2H ~ $ sudo apt-get-install nfs-common
sudo: apt-get-install: command not found
I can't help you with the actual NFS part of this topic but your command sequence is incorrect. It should be:

Code: Select all

sudo apt-get install nfs-common
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Beginner Questions”