using /etc/fstab to mount exported NFS files SOLVED

All Gurus once were Newbies
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. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
User avatar
WharfRat
Level 21
Level 21
Posts: 13900
Joined: Thu Apr 07, 2011 8:15 pm

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

Post by WharfRat »

Just so you know I installed the nfs server on one of my machines and sudo mount -vt nfs,defaults 192.168.1.103:/home/bill /mnt worked for me.

What does mountpoint /mnt/d0 show :?:

If you don't have nmap installed then sudo apt-get install nmap and paste back nmap 192.168.0.2
ImageImage

rene
Level 15
Level 15
Posts: 5937
Joined: Sun Mar 27, 2016 6:58 pm

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

Post by rene »

WharfRat wrote:
Tue Apr 03, 2018 8:13 pm
Just so you know I installed the nfs server on one of my machines and sudo mount -vt nfs,defaults 192.168.1.103:/home/bill /mnt worked for me.
Only by virtue of "nfs", one of the comma- separated list of types, succeeding. It it does not as for poster previously you get the "unknown filesystem type" complaint he got. Certainly the comma does not work to supply mount options.

But, in any case, now that poster installed nfs-client seems everything is just working Linux-sides. I rather doubt poster would not have noticed if the exported directories in fact are empty, so, who knows...

roy pittman
Level 1
Level 1
Posts: 33
Joined: Sat Jun 10, 2017 2:13 pm

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

Post by roy pittman »

Thank you both.
I did not have nmap installed. I installed it. I got this:
roy@sartoris ~ $ nmap 192.168.0.2
Starting Nmap 7.01 ( https://nmap.org ) at 2018-04-05 14:57 MST
Nmap scan report for ratliff (192.168.0.2)
Host is up (0.00022s latency).
Not shown: 994 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
1022/tcp open exp2
1023/tcp open netvenuechat
2049/tcp open nfs
6000/tcp open X11

Nmap done: 1 IP address (1 host up) scanned in 12.13 seconds

I then ran:
roy@sartoris ~ $ sudo mount -vt nfs,defaults 192.168.1.103:/home/bill /mnt
[sudo] password for roy:
mount.nfs: timeout set for Thu Apr 5 15:03:00 2018
mount.nfs: trying text-based options 'vers=4,addr=192.168.1.103,clientaddr=192.168.0.5'
mount.nfs: mount(2): Connection timed out
mount.nfs: Connection timed out
roy@sartoris ~ $

My ratliff box runs netBSD7 on a dedicated OS drive and has a 4 tB RAID 5 running for non-OS files.
This was set up with MUCH guidance from an EE graduate of TX-A&M who is truly a guru.
I shrink from destroying this installation but I cannot use my files on sartoris (Mint Linux Sylvia)
unless I find a way to mount ratliff:/d0 on sartoris. This is my motivation for posting all these questions.
Thank you both again.
Nonetheless, I am considering scp-ing all my non-OS files which are on ratliff:/d1 to a utility drive on sartoris
then installing Mint Linux on ratliff:/d1 and setting up RAID5 on ratliff
(per https://www.pcsteps.com/509-software-ra ... ntu-linux/)
then moving my data files back to newly Minted sartoris.

User avatar
WharfRat
Level 21
Level 21
Posts: 13900
Joined: Thu Apr 07, 2011 8:15 pm

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

Post by WharfRat »

Shouldn't you be using sudo mount -vt nfs -o defaults 192.168.0.2:/d0 /mnt/d0 :?
ImageImage

roy pittman
Level 1
Level 1
Posts: 33
Joined: Sat Jun 10, 2017 2:13 pm

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

Post by roy pittman »

That worked! Thanks so much!

roy pittman
Level 1
Level 1
Posts: 33
Joined: Sat Jun 10, 2017 2:13 pm

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

Post by roy pittman »

Actually there is one more thing. How would I get the same results with my sartoris:/etc/fstab?
At present my sartoris:etc/fstab is as follows:
roy@sartoris /mnt $ cat /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).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=d47d3fb2-7836-4838-ba8d-6b4d041d6afb / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=5de2b03f-4bae-4b6b-9b4c-22c2f61ace15 none swap sw 0 0

UUID=da0a939b-3ded-407e-9f01-113e860f83d5 /mnt/old_d0 ext4 defaults 0 3
UUID=03ea7c23-74b7-4806-88c8-1e46e27ee6f1 /mnt/old_d1 ext4 defaults 0 3
#
# to mount ratliff dO and d1 at boot (old)
#ratliff:/d0 /mnt/d0 nfs noauto,rw,automount 0 0
#ratliff:/d1 /mnt/d1 nfs noauto,rw,automount 0 0

I have commented out lines (that didn't work) to mount the remote directories.

and my /mnt directory looks like this:

roy@sartoris /mnt $ ls -l
total 20
drwxr-xr-x 6 root root 512 May 31 2017 d0
drwxr-xr-x 16 roy root 512 Jul 5 2017 d1
drwxr-xr-x 3 root root 4096 Apr 6 08:59 old_d0
drwxr-xr-x 3 root root 4096 Apr 6 08:59 old_d1
roy@sartoris /mnt $

User avatar
WharfRat
Level 21
Level 21
Posts: 13900
Joined: Thu Apr 07, 2011 8:15 pm

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

Post by WharfRat »

I always used the IP from fstab so try 192.168.0.2:/d0 /mnt/d0 nfs rw,nofail,users 0 0
ImageImage

roy pittman
Level 1
Level 1
Posts: 33
Joined: Sat Jun 10, 2017 2:13 pm

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

Post by roy pittman »

I am going to try two new things, one at a time. Here is my sartoris:/etc/fstab:

roy@sartoris /etc $ sudo vi fstab
[sudo] password for roy:
roy@sartoris /etc $ cat 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).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=d47d3fb2-7836-4838-ba8d-6b4d041d6afb / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=5de2b03f-4bae-4b6b-9b4c-22c2f61ace15 none swap sw 0 0
==========================================================
I got the UUIDs below from $ sudo rpcinfo -p 192.168.0.2 | grep "nfs" :?:
==========================================================
UUID=da0a939b-3ded-407e-9f01-113e860f83d5 /mnt/d0 ext4 defaults 0 3
UUID=03ea7c23-74b7-4806-88c8-1e46e27ee6f1 /mnt/d1 ext4 defaults 0 3
==========================================================
credit where credit is due!
==========================================================
#192.168.0.2:/d0 /mnt/d0 nfs rw,nofail,users 0 0 # per Wharf Rat
# to mount ratliff dO and d1 at boot (old)
#ratliff:/d0 /mnt/d0 nfs noauto,rw,automount 0 0
#ratliff:/d1 /mnt/d1 nfs noauto,rw,automount

roy pittman
Level 1
Level 1
Posts: 33
Joined: Sat Jun 10, 2017 2:13 pm

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

Post by roy pittman »

Success! I was not able to do the mount with sartoris:/etc/fstab or with my crontab, but i wrote a very simple shell script and had sartoris:/etc/rc.local call it. Now ratliff:/d1 ( where twelve years of files are stored) is automatically mounted on boot. And I still have my NetBSD installation intact! Thanks for all the help!

Roy

Post Reply

Return to “Newbie Questions”