exportfs | grep "$dir"
showmount -a  | grep $dir
sudo mount $host:$dir $mnt



rpc.mountd[12997]: refused mount request from $ip for /local (/local): illegal port 59240


# Setting up sudo (1:1.6.8p12-4osso28+0m6) ...
~ # sudo /sbin/insmod /lib/modules/
setreuid(ROOT_UID, 1): Operation not permitted


mount.nfs: requested NFS version or transport protocol is not supported

MESSAGE : "Stale NFS file handle"

mv: preserving times for `${symlink}': Stale NFS file handle
rsync: failed to set times on "${symlink}": Stale NFS file handle (116)

Workaround : (on client)

cat<<EOF > /bin/
# !/bin/sh
busybox ln $@ || echo "ignore: $_"
mv /bin/ln /bin/ln.orig
busybox ln -fs /bin/ /bin/ln

More :

@tag: rsync raid fs link

MESSAGE : "No such device"

mount -v /mnt/nas
mount.nfs: timeout set for Tue Jul 26 14:59:52 2011
mount.nfs: trying text-based options 'nolock,vers=4,addr=,clientaddr='
mount.nfs: mount(2): No such device
mount.nfs: No such device
modprobe -v nfs
FATAL: Module nfs not found.
grep -i nfs /mnt/dev/sda1/config-2.6.39-6.15-adaptation-pinetrail
# CONFIG_NFS_FS is not set
# CONFIG_NFSD is not set
zypper si `rpm -q --qf '%{SOURCERPM}\n' kernel-adaptation-pinetrail `
Source package 'kernel-adaptation-pinetrail-2.6.39-6.15.src.rpm' not found.
zypper install build rpmbuild perl-XML-Parser relfutils-libelf-devel binutils-devel newt-devel ncurses-devel      
rpm2cpio ../*.rpm | cpio -id

Message : mount.nfs: ... failed: timed out

mount.nfs: mount to NFS server '%s' failed: timed out, retrying 

How: on client:nrv laptop debian server:RAID

Cause: Check for rules in :



iptables -L ; iptables -F RH-Lokkit-0-50-INPUT || sudo iptables -F 


settings :

iptables -A INPUT -p tcp --dport 2049 -j ACCEPT
iptables -A INPUT -p tcp --dport 4000 -j ACCEPT
iptables -A INPUT -p tcp --dport 4001 -j ACCEPT
iptables -A INPUT -p tcp --dport 4002 -j ACCEPT
iptables -A INPUT -p tcp --dport 4003 -j ACCEPT
iptables -A INPUT -p tcp --dport 111 -j ACCEPT


showmount -a portmap getport: RPC: Success

mount -t nfs -o rw /tmp/mnt/uri/nfs/
mount: RPC: Unable to receive; errno = Connection refused


mount: mounting $host:$path on $path failed: Bad file descriptor
mount.nfs: access denied by server while mounting $host:$share

NFS : [[Network]] [[FileSystem]]

sudo apt-get install nfs-common nfs-kernel-server # On [[Debian]] [[Linux]]

I wanted to share home between 2 Computers : localhost and remote (wich is an alias) :

# ${EDITOR} /etc/hosts # @ server       localhost   local   remote
# ${EDITOR} /etc/hosts # @ client       localhost   local   remote

Server Side :

# su
${EDITOR} /etc/exports  # root@server #
/home localhost(rw,insecure,all_squash,sync)
/home remote(rw,insecure,all_squash,sync)
## /home *(ro,insecure) # insecure on a network
# /etc/init.d/nfs-kernel-server restart # statd ?
# rpcinfo -p localhost
# /etc/hosts.allow
# /etc/hosts.deny
sudo invoke-rc.d nfs-kernel-server restart

Client Side :

mount remote:/home /mnt/tmp -t nfs # Hostname = remote
# ${EDITOR} /etc/fstab
remote:/home /mnt/nfs/remote/home  nfs auto,users 0 0
## localhost:/home /mnt/nfs/home nfs users 0 0 # useless
# mkdir -p /mnt/nfs/remote/home

Remove home :

adduser user
# mv /home/user /home/user-local/
# mkdir -p /home/user-remote
# ln -fs /mnt/nfs/remote/home/user  /home/user-remote
# cd /home && ln -fs user-remote user
# ssh user@client echo ${HOME}

Now it is over :) do it again swaping 'client' and 'server' if needed

Error on Client :

# mount /mnt/nfs/nrv/home
mount: RPC: Program not registered # ???
Not starting NFS kernel daemon: No exports. # check your /etc/exports
# rpcinfo -p remote
 program vers proto   port
  100000    2   tcp    111  portmapper
  100000    2   udp    111  portmapper
# rpcinfo -p localhost
 program vers proto   port
  100000    2   tcp    111  portmapper
  100000    2   udp    111  portmapper
  100024    1   udp    715  status
  100024    1   tcp    718  status

UID read only :

adduser --uid 9999 user # @server
adduser --uid 9999 user # @client
/home remote(rw,insecure,all_squash,anonuid=9999,anongid=9999)
## as user
mount /mnt/nfs/home
man exports exportfs
## misc :
ln -s /mnt/nfshome/user /home/user/nfshome
mkdir -p $HOME/mnt/tmp
umount $HOME/mnt/tmp
mount -t nfs $HOSTNAME:/ $HOME/mnt/tmp


LS-WTGL490:~# unfsd -h
UNFS3 unfsd 0.9.21 (C) 2006, Pascal Schmidt <>
Usage: unfsd [options]
        -h          display this short option summary
        -u          use unprivileged port for services
        -d          do not detach from terminal
        -e <file>   file to use instead of /etc/exports
        -i <file>   write daemon pid to given file
        -c          enable cluster extensions
        -C <path>   set path for cluster extensions
        -n <port>   port to use for NFS service
        -m <port>   port to use for MOUNT service
        -t          TCP only, do not listen on UDP ports
        -p          do not register with the portmapper
        -s          single user mode
        -b          enable brute force file searching
        -l <addr>   bind to interface with specified address
        -r          report unreadable executables as readable
        -T          test exports file and exit

+ /usr/sbin/invoke-rc.d unfs3 start
Starting unfs3: Cannot register service: RPC: Unable to receive; errno = Connection refused
unable to register (NFS3_PROGRAM, NFS_V3, udp).
invoke-rc.d: initscript unfs3, action "start" failed.

Solution start portmap first

@tag: nfs


Remember connect drive as host:/share



# NFS Bug on mounted NFS or SMB Filesystem ?
#~/tmp/WIN32/#$ mkdir -p dir/dir
#~/tmp/WIN32/#$ ln -s ./dir/dir dot-slash-dir-slash-dir
#~/tmp/WIN32/#$ ln -s ../dir dot-dot-slash-dir
# 2d link appaear as empty file, while 1st one as dir on windows

nfs errors

Root-NFS: Server returned error -13 while mounting …

Perm issue check with

showmount -e localhost

error setting ownership of symlink `./lib/': Stale NFS file handle



@TaG: Network FileSystem SMB SSH NIS AutoFs MounT


<iframe width="420" height="315" src="//" frameborder="0" allowfullscreen></iframe>

nfs.txt · Last modified: 2020/09/08 20:46 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki