using /etc/fstab to mount exported NFS files SOLVED

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.
roy pittman

using /etc/fstab to mount exported NFS files SOLVED

Post by roy pittman »

I am not succeeding at mounting exported NFS files from my fileserver ratliff which runs on NetBSD to my workstation sartoris which runs mint linux.
Here are the data:

Here is the listing of my sartoris:/mnt directory
roy@sartoris ~ $ ls -l /mnt
total 8
drwxr-xr-x 2 root root 4096 Mar 29 18:55 d0
drwxr-xr-x 2 root root 4096 Mar 29 18:58 d1

Here is the pertinent part of my my sartoris:/etc/fstab file:
roy@sartoris ~ $ cat /etc/fstab
(snip)
# to mount ratliff dO and d1 at boot
ratliff:/d0 /mnt/d0 nfs defaults 0 0
ratliff:/d1 /mnt/d1 nfs defaults 0 0

Here is my ratliff:/etc/exports file:
1028 [roy@ratliff:/d1/home/roy]$ cat /etc/exports
/d0 -alldirs -maproot=roy:wsrc -network 192.168.0.0/24
/d1 -alldirs -maproot=roy:wsrc -network 192.168.0.0/24

here is the output when I try to mount ratliff:/d0 and ratliff:/d1 on sartoris:
roy@sartoris /etc $ sudo mount -a
mount: wrong fs type, bad option, bad superblock on ratliff:/d0,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)

In some cases useful info is found in syslog - try
dmesg | tail or so.
mount: wrong fs type, bad option, bad superblock on ratliff:/d1,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)

In some cases useful info is found in syslog - try
dmesg | tail or so.

=============================================================
Similarly, the Downloads folder could be exported by putting this line in the /etc/exports file:

home/lsemmens/Downloads 192.168.0.0/24(rw,sync,no_root_squash)
or
/mnt/ntfs-media 192.168.0.0/24(rw,sync,no_root_squash,no_subtree_check)
=============================end of mount -a output================

Any ideas?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: using /etc/fstab to mount exported NFS files

Post by WharfRat »

roy pittman,

I haven't used nfs for a long time and never to a NetBSD, but did you try the IP address rather than ratliff :?:

Try sudo mount -t nfs,defaults IP_ADDRESS:/d0 /mnt/d0 to check it from the terminal.
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

I got this:

roy@sartoris ~ $ sudo mount -t nfs defaults 192.168.0.2:/d0 /mnt/d0
[sudo] password for roy:

Usage:
mount [-lhV]
mount -a [options]
mount [options] [--source] <source> | [--target] <directory>
mount [options] <source> <directory>
mount <operation> <mountpoint> [<target>]

Mount a filesystem.

Options:
-a, --all mount all filesystems mentioned in fstab
-c, --no-canonicalize don't canonicalize paths
-f, --fake dry run; skip the mount(2) syscall
-F, --fork fork off for each device (use with -a)
-T, --fstab <path> alternative file to /etc/fstab
-i, --internal-only don't call the mount.<type> helpers
-l, --show-labels show also filesystem labels
-n, --no-mtab don't write to /etc/mtab
-o, --options <list> comma-separated list of mount options
-O, --test-opts <list> limit the set of filesystems (use with -a)
-r, --read-only mount the filesystem read-only (same as -o ro)
-t, --types <list> limit the set of filesystem types
--source <src> explicitly specifies source (path, label, uuid)
--target <target> explicitly specifies mountpoint
-v, --verbose say what is being done
-w, --rw, --read-write mount the filesystem read-write (default)

-h, --help display this help and exit
-V, --version output version information and exit

Source:
-L, --label <label> synonym for LABEL=<label>
-U, --uuid <uuid> synonym for UUID=<uuid>
LABEL=<label> specifies device by filesystem label
UUID=<uuid> specifies device by filesystem UUID
PARTLABEL=<label> specifies device by partition label
PARTUUID=<uuid> specifies device by partition UUID
<device> specifies device by path
<directory> mountpoint for bind mounts (see --bind/rbind)
<file> regular file for loopdev setup

Operations:
-B, --bind mount a subtree somewhere else (same as -o bind)
-M, --move move a subtree to some other place
-R, --rbind mount a subtree and all submounts somewhere else
--make-shared mark a subtree as shared
--make-slave mark a subtree as slave
--make-private mark a subtree as private
--make-unbindable mark a subtree as unbindable
--make-rshared recursively mark a whole subtree as shared
--make-rslave recursively mark a whole subtree as slave
--make-rprivate recursively mark a whole subtree as private
--make-runbindable recursively mark a whole subtree as unbindable

For more details see mount(8).
roy@sartoris ~ $

I also tried the same command but using "ratliff" instead of ip and got the same result. Yes, ratliff and sartoris are both in /etc/hosts on bothe computers.
WharfRat

Re: using /etc/fstab to mount exported NFS files

Post by WharfRat »

You left out the comma after nfs - sudo mount -t nfs defaults - it should be sudo mount -t nfs,defaults
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

Thank you. I got this:
roy@sartoris /mnt/d1 $ sudo mount -t nfs,defaults 192.168.0.2:/d0 /mnt/d0
mount: unknown filesystem type
roy@sartoris /mnt/d1 $
WharfRat

Re: using /etc/fstab to mount exported NFS files

Post by WharfRat »

Do you have the nfs-client package installed :?:
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

No nfs-client is not (yet) installed. I am not good at apt but will become so. Is the and apt man page? I will look for it.
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

Presently installing nfs-common with apt-get install
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

after $ sudo apt-get install nfs-common I get
roy@sartoris ~ $ sudo mount -a
roy@sartoris ~ $
looks good but
roy@sartoris ~ $ cd /mnt/d1
roy@sartoris /mnt/d1 $ ls
roy@sartoris /mnt/d1 $
????
WharfRat

Re: using /etc/fstab to mount exported NFS files

Post by WharfRat »

Do you get anything from sudo rpcinfo -p 192.168.0.2 | grep "nfs" :?:
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

roy@sartoris ~ $ sudo rpcinfo -p 192.168.0.2 | grep "nfs"
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
roy@sartoris ~ $ roy@sartoris ~ $ date
Sun Apr 1 07:24:36 MST 2018
WharfRat

Re: using /etc/fstab to mount exported NFS files

Post by WharfRat »

After you issue sudo mount -a does it show with mount :?:
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

Thank you!

roy@sartoris ~ $ date
Mon Apr 2 06:34:56 MST 2018
roy@sartoris ~ $ sudo mount -a
[sudo] password for roy:
roy@sartoris ~ $
Looks good, yes? But:
roy@sartoris ~ $ ls /mnt/d0
roy@sartoris ~ $ ls /mnt/d1
roy@sartoris ~ $
so:
roy@sartoris ~ $ mount|grep nfs
roy@sartoris ~ $

I can send the full output of ~$ mount if that will be useful
WharfRat

Re: using /etc/fstab to mount exported NFS files

Post by WharfRat »

Does sudo mount -v -t nfs4,defaults 192.168.0.2:/d0 /mnt/d0 tell you anything :?:
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

Regrettably, not so much:
roy@sartoris ~ $ sudo mount -v -t nfs4,defaults 192.168.0.2:/d0 /mnt/d0
[sudo] password for roy:
mount.nfs4: timeout set for Mon Apr 2 15:22:10 2018
mount.nfs4: trying text-based options 'addr=192.168.0.2,clientaddr=192.168.0.5'
mount.nfs4: mount(2): Protocol not supported
mount.nfs4: Protocol not supported
roy@sartoris ~ $ date
Mon Apr 2 15:20:51 MST 2018
WharfRat

Re: using /etc/fstab to mount exported NFS files

Post by WharfRat »

Do the same with sudo mount -v -t nfs,defaults 192.168.0.2:/d0 /mnt/d0
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: using /etc/fstab to mount exported NFS files

Post by rene »

Please delete the ,defaults from the mount command; mount's -t option specifies the filesystem type, i.e., "nfs". Mount options such as "defaults" would be specified to mount through its -o option --- but in the case of "defaults" you may by virtue of it being, well, default, leave it out altogether.
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

Thank you. I got:

roy@sartoris ~ $ sudo mount -v -t nfs 192.168.0.2:/d0 /mnt/d0
[sudo] password for roy:
mount.nfs: timeout set for Tue Apr 3 03:00:59 2018
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.2,clientaddr=192.168.0.5'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=192.168.0.2'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.0.2 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.0.2 prog 100005 vers 3 prot UDP port 1017
roy@sartoris ~ $ date
Tue Apr 3 03:00:21 MST 2018
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: using /etc/fstab to mount exported NFS files

Post by rene »

This seems to indicate it mounted successfully.
roy pittman

Re: using /etc/fstab to mount exported NFS files

Post by roy pittman »

Thank you.
Perhaps so but I get:
roy@sartoris ~ $ ls /mnt/d0
roy@sartoris ~ $ ls /mnt/d1
roy@sartoris ~ $
Locked

Return to “Beginner Questions”