Fstab help please

good day

i have been trying to do this on my own for quite a few days now and i just cant seem to get it right, i dont know what i’m missing.

i have a smb and nfs share on my home local server, i can access it on all my devices except through fstab , i can mount it manually as well using

mount -t auto //192.168../folder /srv/nfs/folder

in my fstab i have this;

//192.168../folder /srv/nfs/music nfs user=angelus,pass=********,_netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=340s,x-system.idle-time=25min 0 0

out put of status systemd-networkd-wait-online.service;

[angelus@Angelus ~]$ systemctl status systemd-networkd-wait-online.service
● systemd-networkd-wait-online.service - Wait for Network to be Configured
Loaded: loaded (/usr/lib/systemd/system/systemd-networkd-wait-online.service; enabled; vendor preset: disabled)
Active: active (exited) since Tue 2021-05-11 12:25:23 SAST; 40min ago
Docs: man:systemd-networkd-wait-online.service(8)
Process: 308 ExecStart=/usr/lib/systemd/systemd-networkd-wait-online (code=exited, status=0/SUCCESS)
Main PID: 308 (code=exited, status=0/SUCCESS)
CPU: 5ms

May 11 12:25:10 Angelus systemd[1]: Starting Wait for Network to be Configured…
May 11 12:25:23 Angelus systemd[1]: Finished Wait for Network to be Configured.

output of /etc/exports;

/etc/exports - exports(5) - directories exported to NFS clients

> # Example for NFSv2 and NFSv3:
> # /srv/home hostname1(rw,sync) hostname2(ro,sync)
> # Example for NFSv4:
> # /srv/nfs4 hostname1(rw,sync,fsid=0)
> # /srv/nfs4/home hostname1(rw,sync,nohide)
> # Using Kerberos and integrity checking:
*> # /srv/nfs4 (rw,sync,sec=krb5i,fsid=0)
*> # /srv/nfs4/home (rw,sync,sec=krb5i,nohide)
**> Use exportfs -arv to reload

soooooooo i dont know lol please if anyone can advise perhaps where iam going wrong or what is missing or what i can check on

edit: removed bold text

That isn’t the correct format for an nfs mount. It looks like you have combined a mix of things from smb and nfs and they are different.

Here is what my nfs mounts look like:

192.168.2.154/music /srv/nfs/music nfs x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0

Also, /etc/exports is for an nfs server. You shouldn’t need anything special in that for an nfs client.

ok i made mine look the same;

//192.168.2.154/music /srv/nfs/music nfs x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0

now it gives me this error

failed to open directory “music” error opening directory ‘/srv/nfs/music’: no such device

What gives you that error?

Did you umount your manual mount first?

After making sure it is unmounted you can test the mount with sudo mount /srv/nfs/music

Also, I copied and pasted your location but is that a typo? Should it be svr?

i got that error after i changed the line in fstab and then saved fstab and restarted and then browed to /srv/nfs/music and then it told me that error. but no i did not umount before the restart

yes i checked now “srv” is correct, if i go; file system > srv > nfs > music

if i do the test this happens

[angelus@Angelus ~]$ sudo mount /srv/nfs/music
mount.nfs: remote share not in ‘host:dir’ format

Can we see the contents of /etc/fstab

/etc/fstab: static file system information.

Use ‘blkid’ to print the universally unique identifier for a device; this may
be used with UUID= as a more robust way to name devices that works even if
disks are added and removed. See fstab(5).


UUID=6ff6ad6d-f310-4764-873e-89b7884e38ec / ext4 defaults,noatime 0 1
UUID=9d0940fc-7903-40c0-aab0-7ad78aca66bd /mnt/ ext4 rw,auto,user,suid,exec 0 0
//192.168.2.154/music /srv/nfs/music nfs x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0

You added // at the beginning. That isn’t part of an nfs mount.

You should be able to copy and paste the line I gave you exactly without any changes.

ok copied it as you had it now and restarted but when i browse to /srv/nfs/music it gives the error

failed to open directory “music” error opening directory ‘/srv/nfs/music’: no such device

updated fstab

#<file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=6ff6ad6d-f310-4764-873e-89b7884e38ec /              ext4    defaults,noatime 0 1
UUID=9d0940fc-7903-40c0-aab0-7ad78aca66bd /mnt/ ext4 rw,auto,user,suid,exec 0 0
192.168.2.154/music /srv/nfs/music nfs x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0

dont know if this helps

[angelus@Angelus srv]$ ls -l
total 12
dr-xr-xr-x 2 root ftp  4096 Jan 19 03:32 ftp
drwxr-xr-x 2 root root 4096 Jan 19 03:32 http
drwxrwxrwx 3 root root 4096 May 10 15:10 nfs
[angelus@Angelus srv]$ cd nfs
[angelus@Angelus nfs]$ ls -l
total 4
drwxrwxrwx 2 root root 4096 May 10 15:10 music
[angelus@Angelus nfs]$ cd music
[angelus@Angelus music]$ ls -l
total 0
[angelus@Angelus music]$

What error do you get if you type sudo mount /srv/nfs/music

[angelus@Angelus ~]$ sudo mount /srv/nfs/music
[sudo] password for angelus:
mount.nfs: remote share not in ‘host:dir’ format
[angelus@Angelus ~]$

That is my fault.

I dropped the colon.

Try this:

192.168.2.154:/music /srv/nfs/music nfs x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0

ok i changed it to that and rebooted but it didnt mount on restart, so i ran;

sudo mount /srv/nfs/music
[sudo] password for angelus:
mount.nfs: mounting 192.168.2.154:/music failed, reason given by server: No such file or directory
[angelus@Angelus ~]$

there was a command i stumbled on that will display available shares even if not mounted um, :thinking:

What is the server?

Is it possible that /music isn’t what it is called on nfs?

For example, I have a Synology and when you connect via smb it is //server/share but when you connect via nfs it is server:/volume/share

EDIT: Also, did you give your client IP permissions to connect?

yeah iam thinking about that now … my server is running omv with smb/cifs and nfs share. i’m digging in omv now to see if i can spot anything on the real folder path …

there is a section for shared folders
and under “shared folders in use” it displays
image

and under “shared folders” it displays


where Music/ is labeled as relative path

under nfs shares it displays
image

Is 192.168.2.150 the IP of the client machine you are trying to connect from?

correct yes

For OMV it looks like you can look in /etc/exports on the OMV server to get the share name.

It looks like by default it is /export/sharename. Keep in mind it is case sensitive.

ok so then it would be

192.168.2.154:/export/Music /srv/nfs/music nfs x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0

Try it! :slight_smile:

1 Like