===== USAGE =====
dir=...
mnt=/tmp/mnt/nfs/$dir
host=localhost
exportfs | grep "$dir"
showmount -a | grep $dir
sudo mount $host:$dir $mnt
===== TODO =====
* http://www.scribd.com/doc/47575293/Build-Meego-on-Samsung-netbook-with-NFS-support# TFtP MeeGo
* http://forums.debian.net/viewtopic.php?f=5&t=70798&p=404676#p404676 LoG HalT
===== ERROR =====
rpc.mountd[12997]: refused mount request from $ip for /local (/local): illegal port 59240
* https://serverfault.com/questions/107546/mount-nfs-access-denied-by-server-while-mounting#
/local/tmp 192.0.0.0/255.0.0.0(rw,sync,no_root_squash,no_subtree_check,insecure)
==== MEEGO ====
# Setting up sudo (1:1.6.8p12-4osso28+0m6) ...
~ # sudo /sbin/insmod /lib/modules/2.6.32.54-dfl61-20121301/nfs.ko
setreuid(ROOT_UID, 1): Operation not permitted
==== MESSAGES ====
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)
* http://www.mail-archive.com/rdiff-backup-users@nongnu.org/msg02375.html
[[Workaround]] : (on client)
cat< /bin/ln.sh
# !/bin/sh
busybox ln $@ || echo "ignore: $_"
EOF
mv /bin/ln /bin/ln.orig
busybox ln -fs /bin/ln.sh /bin/ln
More :
* http://unfs3.sourceforge.net/
* http://www.nslu2-linux.org/wiki/Optware/Unfs3
* http://forums.buffalotech.com/t5/Storage/Linkstation-Pro-Duo-NFS-capable/m-p/1738/highlight/true#M1523
* http://launchpadlibrarian.net/26364657/unfs3_0.9.22%2Bdfsg-1_armel.deb
@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=192.168.0.90,clientaddr=192.168.0.25'
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
wget http://repo.meego.com/MeeGo/builds/trunk/latest/repos/oss/source/kernel-adaptation-pinetrail-2.6.39-6.15.src.rpm
rpm2cpio ../*.rpm | cpio -id
https://meego.gitorious.org/meego-os-base/kernel-source/blobs/history/master/config-x86
==== 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 :
/etc/init.d/lokkit
Workaround:
iptables -L ; iptables -F RH-Lokkit-0-50-INPUT || sudo iptables -F
More:
* http://wiki.debian.org/SecuringNFS
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
==== FAIL TO MOUNT ====
showmount -a 192.168.0.179
portmap getport: RPC: Success
mount -t nfs -o rw 192.168.0.179:/mnt/array1 /tmp/mnt/uri/nfs/192.168.0.179/
mount: RPC: Unable to receive; errno = Connection refused
===== ERRORS ====
mount: mounting $host:$path on $path failed: Bad file descriptor
mount.nfs: access denied by server while mounting $host:$share
* http://unix.stackexchange.com/questions/106122/mount-nfs-access-denied-by-server-while-mounting-on-ubuntu-machines
==== NFS : [[Network]] [[FileSystem]] ====
* http://packages.qa.debian.org/n/nfs-utils.html
* http://sourceforge.net/projects/nfs
* http://nfs.sourceforge.net/nfs-howto/
sudo apt-get install nfs-common nfs-kernel-server # On [[Debian]] [[Linux]]
I wanted to share home between 2 [[Computer]]s : localhost and remote (wich is an alias) :
# ${EDITOR} /etc/hosts # @ server
127.0.0.1 localhost
192.168.1.154 local
192.168.1.100 remote
# ${EDITOR} /etc/hosts # @ client
127.0.0.1 localhost
192.168.1.100 local
192.168.1.154 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
http://www.xenos.net/library/nfshome.html
==== USERLAND NFS ====
* http://packages.qa.debian.org/u/unfs3.html
* http://unfs3.sourceforge.net/
* https://launchpad.net/ubuntu/+source/unfs3
* http://ftp.aarnet.edu.au/debian/pool/main/u/unfs3/unfs3_0.9.21+dfsg-1.dsc
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 to use instead of /etc/exports
-i write daemon pid to given file
-c enable cluster extensions
-C set path for cluster extensions
-n port to use for NFS service
-m 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 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]]
==== NFS SFU ====
Remember connect drive as host:/share
* http://ubuntuforums.org/showthread.php?t=310168
==== [[SMB]] ====
# 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/libpthread.so.0': Stale NFS file handle
===== MISC =====
nfs-common: /sbin/showmount
* http://opensource.franz.com/nfs/# [[WindowsSoftware]]
* https://wiki.archlinux.org/index.php/NFS#Mount_using_.2Fetc.2Ffstab_with_systemd SystemD
* https://stackoverflow.com/questions/10367577/mmap-file-shared-via-nfs#
* https://serverfault.com/questions/340296/how-do-i-speed-up-and-cache-mmap-file-access-over-nfs-on-linux#
* https://about.gitlab.com/2018/11/14/how-we-spent-two-weeks-hunting-an-nfs-bug/# BuG
===== MORE =====
@TaG: [[Network]] [[FileSystem]] [[SMB]] [[SSH]] [[NIS]] [[AutoFs]] MounT
{{http://liquidcode.org.nyud.net:8090/%7Elostman/stuff/sky_puter/sky_puter6.jpg?nocache}}