# NFS - Live CD - Fixit



## tnn (May 12, 2010)

Hi all,

I recently had a SCSI disk go bad, and wanted to restore the data to a new drive. I installed the new (pre newfs and labeled) drive into the system, and tried to connect it to a nfs server (on the local network).

The client was not able to connect to the share. Each time I tried to mount the nfs volume (using the FreeBSD Live Cd Fixit Console), I got an error message:


```
RPCPROG_NFS: PRC: Program not registered.
```

Is there something I am forgetting to do?

Details:

After booting the client system, I gave it a local address: 

`ifconfig em1 inet 192.168.0.5/24`

Tested that it could ping the nfs server, no problem.

Created a dir in / called /enterprise

Used the mount command:

`mount 192.168.0.4:/mnt /enterprise`

Bu all I kept getting was an error:


```
RPCPROG_NFS: RPC: Program not registered
```

I even tried to start an nfsiod with no luck:

`nfsiod -n 4`

No process ever showed.

Any tips or hints would be appreciated,

-Grant.


----------



## SirDice (May 12, 2010)

Rpcbind isn't running.


----------



## tnn (May 13, 2010)

So, rpcbind needs to be running on the clinet then?

-Grant


----------



## SirDice (May 14, 2010)

tnn said:
			
		

> So, rpcbind needs to be running on the clinet then?


Not on the client. It looks like RPC is running on the server but not everything for NFS. 

Have a look with `$ rpcinfo <server>`
You should at least see mountd and nfsd.

`# showmount -e <server>`
Will show you the exported filesystems.

Then just mount it using something like: `# mount server:/some/exported/dir /mnt/local/dir`
No need to run anything else on the client.


----------



## tnn (May 14, 2010)

SirDice said:
			
		

> Not on the client. It looks like RPC is running on the server but not everything for NFS.
> 
> Have a look with `$ rpcinfo <server>`
> You should at least see mountd and nfsd.
> ...



Since the server I was originally have the issues getting connected to the nfs server is now up and running,  I ran the commands you suggested on the nfs server, the results are below.

Perhaps I didnt mention, but the NFS server WAS up and running and several other clients were connected to it. 

Here is the rpcinfo output:


```
enterprise# rpcinfo
   program version netid     address                service    owner
    100000    4    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    3    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    2    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    4    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    3    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    2    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    4    local     /var/run/rpcbind.sock  rpcbind    superuser
    100000    3    local     /var/run/rpcbind.sock  rpcbind    superuser
    100000    2    local     /var/run/rpcbind.sock  rpcbind    superuser
    100005    1    udp       0.0.0.0.3.254          mountd     superuser
    100005    3    udp       0.0.0.0.3.254          mountd     superuser
    100005    1    tcp       0.0.0.0.3.255          mountd     superuser
    100005    3    tcp       0.0.0.0.3.255          mountd     superuser
    100003    2    udp       0.0.0.0.8.1            nfs        superuser
    100003    3    udp       0.0.0.0.8.1            nfs        superuser
```

Here is the mount info:


```
enterprise# showmount -e
Exports list on localhost:
/mnt                               192.168.0.0
```

here is the exact command I was running on the client:
(the enterprise directory (mountpoint) was made).

`mount 192.168.0.4:/mnt /enterprise`

If it means anything, the nfs server was/is running FreeBSD 5.2.1.

-Grant


----------



## JimW (May 15, 2010)

Have you run [cmd=]showmount -e _server_[/cmd] from the client... and if so, what was the result?

Are there any NFS related messages in the /var/log/messages file on the NFS server?

How is the server configured? Post the server's rc.conf stuff related to what and how it is loading it's NFS services.

Is it possible that there could be a tcpwrapper issue on the server? Check the server's /etc/hosts.allow file.


----------



## SirDice (May 15, 2010)

The showmount and rpcinfo commands should be run on the client.


----------



## tnn (May 15, 2010)

OK Guys,

As mentioned, the client is now back up and running (I was able to move the data back to them via thumb drive).

Next time I am at the NOC I will attempt to recreate the failure and get the logs, run showmount etc.

Thnanks thus far,

-Grant


----------



## tnn (May 26, 2010)

Hey Guys, Let me as a simpler question. 

Should I be able to boot using the Live CD and mount a NFS mount on another server (the live file system (CD) would be the client?


----------



## SirDice (May 26, 2010)

tnn said:
			
		

> Should I be able to boot using the Live CD and mount a NFS mount on another server (the live file system (CD) would be the client?



Yes, that's possible and you should be able to.


----------



## JimW (May 28, 2010)

tnn said:
			
		

> Hey Guys, Let me as a simpler question.
> 
> Should I be able to boot using the Live CD and mount a NFS mount on another server (the live file system (CD) would be the client?



Yes... it works.

This has been my experience mounting an NFS server with the LiveCD "Fixit" option...

-- First configure yourself an IP address as soon as you enter the shell (which it seems you did)

-- Then you can go and load your NFS client...

```
nfsiod -n 4
```

-- You need to create a file and directory for /var/db/mounttab

```
mkdir /var/db

touch /var/db/mounttab
```

(Without doing that, you won't be able to mount and will get an error because /var/db and /var/db/mounttab don't exist in the Fixit environment)

-- The Fixit NFS client uses UDP by default and doesn't even appear to try TCP (Note that is with versions 7.3 and lower. I haven't tried 8.0's LiveCD and Fixit) If your server is using TCP only, you will need to explicitly tell the mount command to use TCP with the *-o tcp* option on the command line.

Pretty much, that is it. NFS works fine in the Fixit environment if you remember to follow these few steps.


----------



## tnn (May 28, 2010)

Jim,

I pretty much did exactly the same as you suggested. 

After running the nfsiod -n 4, and checked the process list, there was no nfsiod process to be found.

Also, the NFS server is running FreeBSD 5.2.1. (Again, the client was using FreeBSD 8.0 Live CD, fixit).

-G


----------



## JimW (May 29, 2010)

tnn said:
			
		

> Jim,
> 
> I pretty much did exactly the same as you suggested.
> 
> After running the nfsiod -n 4, and checked the process list, there was no nfsiod process to be found.



Yeah.... That seems to be normal for the "Fixit" shell. Even after loading up NFS, when running *top* it will just show you two processes. I think top itself and maybe the shell. You probably have to run *top* with one of it's switches to see everything.

As long as you didn't get an error when loading *nfsiod*, it was running. Keep the faith bro. 



> Also, the NFS server is running FreeBSD 5.2.1. (Again, the client was using FreeBSD 8.0 Live CD, fixit).



Without knowing how your NFS server is configured, or seeing your output of [cmd=]rpcinfo 192.168.0.4[/cmd] from within your Fixit shell client environment, it is difficult to know why you were having the problem.


----------



## tnn (Jul 6, 2010)

*NFS Wierdness AGAIN!*

Hi again,

Since I started the thread, I have managed to get FReeBSD 8 loaded onto three servers, one of which is the NFS server. The new strange thing is that 5 other servers I have (FreeBSD 6.x) are able to connect to the (now FreeBSD 8) NFS server. The other two servers, that used to be FreeBSD 6.x and used to connect OK, are now FreeBSD8 and cant connect! I guess this is leading me to think it IS a client issue, not a server issue. I had to pear down this post abit for this forum, so I have removed some of the redundant test from the ps output etc below.

HERE IS THE NFS SERVER CONFIGS


```
enterprise# uname -v
FreeBSD 8.0-RELEASE-p3 #0: Fri Jun 11 09:42:51 EDT 2010
```

My hosts.allow is untouched, and the first rule is:


```
ALL : ALL : allow
```

RC.CONF

```
enterprise# more rc.conf
# -- sysinstall generated deltas -- # Sun Dec 27 14:02:59 2009
# Created: Sun Dec 27 14:02:59 2009
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="enterprise.<mydomain.com>"
rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_flags="-r"
kern_securelevel_enable="NO"
keymap="us.iso"
usbd_enable="YES"
proftpd_enable="YES"
named_enable="NO"
named_flags="-t /var/named -u bind"
apache22_enable="YES"
apache22_http_accept_enable="YES"
mysql_enable="YES"
ipv6_enable="NO"
enable_quotas="NO"
linux_enable="NO"
inetd_enable="NO"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sshd_enable="YES"
spamd_enable="NO"
exim_enable="NO"
firewall_enable="YES"
firewall_script="/etc/ipfw.rules"
firewall_logging="YES"
ipa_enable="NO"
webmin_enable="YES"
usermin_enable="NO"
bruteblockd_enable="NO"
bruteblockd_table="1"
bruteblockd_flags="-s 5"
defaultrouter="nnn.nnn.nnn.nnn"
ifconfig_fxp0="inet nnn.nnn.nnn.nnn netmask nnn.nnn.nnn.nnn broadcast nnn.nnn.nnn.nnn"
ifconfig_fxp1="inet 192.168.0.4 netmask 255.255.255.0 broadcast 192.168.0.255"
```

IPFWE List OUTPUT


```
enterprise# ipfw -a list
00001   112     6150 allow ip from any to any via lo0
00002 92776 73740050 allow ip from any to any via fxp0
00003   992    97690 allow ip from any to any via fxp1
65535     0        0 deny ip from any to any
```

THE EXPORTS FILE:


```
enterprise# more exports
/mnt -alldirs -mapall root -network 192.168.0.0 -mask 255.255.255.0
enterprise#
```

RPCINFO (FROM SERVER)


```
enterprise# rpcinfo
   program version netid     address                service    owner
    100000    4    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    3    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    2    tcp       0.0.0.0.0.111          rpcbind    superuser
    100000    4    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    3    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    2    udp       0.0.0.0.0.111          rpcbind    superuser
    100000    4    tcp6      ::.0.111               rpcbind    superuser
    100000    3    tcp6      ::.0.111               rpcbind    superuser
    100000    4    udp6      ::.0.111               rpcbind    superuser
    100000    3    udp6      ::.0.111               rpcbind    superuser
    100000    4    local     /var/run/rpcbind.sock  rpcbind    superuser
    100000    3    local     /var/run/rpcbind.sock  rpcbind    superuser
    100000    2    local     /var/run/rpcbind.sock  rpcbind    superuser
    100005    1    udp6      ::.2.145               mountd     superuser
    100005    3    udp6      ::.2.145               mountd     superuser
    100005    1    tcp6      ::.2.145               mountd     superuser
    100005    3    tcp6      ::.2.145               mountd     superuser
    100005    1    udp       0.0.0.0.2.145          mountd     superuser
    100005    3    udp       0.0.0.0.2.145          mountd     superuser
    100005    1    tcp       0.0.0.0.2.145          mountd     superuser
    100003    2    udp       0.0.0.0.8.1            nfs        superuser
    100005    3    tcp       0.0.0.0.2.145          mountd     superuser
    100003    3    udp       0.0.0.0.8.1            nfs        superuser
```

PROCESS LIST (FROM SERVER)


```
enterprise# ps ax
...
  PID  TT  STAT      TIME COMMAND
 
  536  ??  Is     0:00.00 /sbin/devd
  683  ??  Ss     0:00.28 /usr/sbin/syslogd -s
  699  ??  Ss     0:00.14 /usr/sbin/rpcbind
  792  ??  Is     0:00.01 /usr/sbin/mountd -r
  794  ??  Ss     0:01.01 nfsd: master (nfsd)
  906  ??  Is     0:00.87 proftpd: (accepting connections) (proftpd)
  911  ??  Ss     0:03.03 /usr/bin/perl /usr/local/webmin-1.440
  998  ??  Ss     0:04.15 /usr/local/sbin/httpd
 1017  ??  Is     0:00.01 /usr/sbin/sshd
 1026  ??  Is     0:00.41 /usr/sbin/cron -s
 1116  ??  I      0:00.20 /usr/local/sbin/httpd
 5111  ??  Is     0:00.11 sshd: gpeel [priv] (sshd)
 5114  ??  S      0:00.22 sshd: gpeel@pts/0 (sshd)
  929  v0- I      0:00.02 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my
  978  v0- I      1:58.67 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --ba
 1077  v0  Is+    0:00.01 /usr/libexec/getty Pc ttyv0
 1084  v7  Is+    0:00.01 /usr/libexec/getty Pc ttyv7
 5115   0  Is     0:00.03 -tcsh (tcsh)
 5118   0  I      0:00.02 su
 5119   0  R      0:00.18 _su (csh)
 5233   0  R+     0:00.00 ps ax
```

SHOWMOUNT (run on server)


```
enterprise# showmount -e
Exports list on localhost:
/mnt                               192.168.0.0
enterprise#
```
NOW THE NON CONNECTING CLIENT:


```
kelvin# ping enterprise
PING enterprise (192.168.0.4): 56 data bytes
64 bytes from 192.168.0.4: icmp_seq=0 ttl=64 time=0.336 ms
64 bytes from 192.168.0.4: icmp_seq=1 ttl=64 time=0.175 ms
^C
--- enterprise ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.175/0.256/0.336/0.081 ms
kelvin#

kelvin# mount enterprise:/mnt /mnt
[tcp] enterprise:/mnt: RPCPROG_NFS: RPC: Program not registered
^C
kelvin#
```

HERE IS THE RC.CONF on NON CONNECTING CLIENT:


```
# -- sysinstall generated deltas -- # Sun Dec 27 14:02:59 2009
# Created: Sun Dec 27 14:02:59 2009
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="kelvin.thenetnow.com"
nfs_client_enable="YES"
keymap="us.iso"
named_enable="YES"
named_flags="-t /var/named -u bind"
usbd_enable="YES"
keymap="us.iso"
ipv6_enable="NO"
enable_quotas="NO"
kern_securelevel_enable="NO"
linux_enable="NO"
inetd_enable="NO"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sshd_enable="YES"
spamd_enable="NO"
exim_enable="NO"
apache22_enable="NO"
apache22_http_accept_enable="NO"
proftpd_enable="NO"
mysql_enable="NO"
firewall_enable="YES"
firewall_logging="YES"
firewall_script="/etc/ipfw.rules"
ipa_enable="NO"
webmin_enable="NO"
usermin_enable="NO"
bruteblockd_enable="NO"
bruteblockd_table="1"
bruteblockd_flags="-s 5"
defaultrouter="nnn.nnn.nnn.nnn"
ifconfig_bge0="inet nnn.nnn.nnn.nnn netmask nnn.nnn.nnn.nnn broadcast nnn.nnn.nnn.nnn"
ifconfig_bge1="inet 192.168.0.11 netmask 255.255.255.0 broadcast 192.168.0.255"
kelvin#
```

IPFW OUTPUT:


```
kelvin# ipfw -a list
00001  40  4194 allow ip from any to any via lo0
00002 572 55135 allow ip from any to any via bge0
00003  73  9656 allow ip from any to any via bge1
65535   0     0 deny ip from any to any
```

OUTPUT OF PS -AX:


```
kelvin# ps ax
  PID  TT  STAT      TIME COMMAND
  113  ??  Is     0:00.00 adjkerntz -i
  405  ??  Is     0:00.01 /sbin/devd
  541  ??  Is     0:00.01 /usr/sbin/syslogd -l /var/run/log -l /var/named/var/run/log -s
  609  ??  Is     0:00.03 /usr/sbin/named -t /var/named -u bind -t /var/named -u bind
  860  ??  Is     0:00.00 /usr/sbin/sshd
  869  ??  Is     0:00.00 /usr/sbin/cron -s
  949  ??  Is     0:00.00 /usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
  968  ??  Is     0:00.04 sshd: gpeel [priv] (sshd)
  971  ??  S      0:00.01 sshd: gpeel@pts/0 (sshd)
  928  v0  Is+    0:00.00 /usr/libexec/getty Pc ttyv0
  935  v7  Is+    0:00.00 /usr/libexec/getty Pc ttyv7
  972   0  Is     0:00.01 -tcsh (tcsh)
  975   0  I      0:00.00 su
  980   0  S      0:00.03 _su (csh)
 1009   0  R+     0:00.00 ps ax
```

Please HELP! 

-Grant


----------



## DutchDaemon (Jul 7, 2010)

*Format your posts!!*


----------



## tnn (Jul 7, 2010)

*Resolved*

All,

I tripped over the answer while reviewing the output of the rpcbind. It seems that the FreeBSD 8 Server was to fault. Once I added some options to the rc.conf file:


```
nfs_server_flags="-t -u -h 192.168.0.4 -n 15"
```

(adding the tcp/udp flags) and rebooted, everything connected lickidy-split.

Thanks for the patience,

-Grant

P.S. I will start researching the formatting of the posts.


----------

