Warn 1: for non-English, use samba/sshfs instead. unless win has NFS v4 or above which can solve non-UTF8 problems.
svchost consumes 1.5GB ram, don't know why.
Combining simlink (
ln -s) with NFS may cause weird file path problems. We tried to have a link at NFS to Dropbox in nfs, also tried to have a link at home to mount point at /mnt. Both caused some minor path and file issues, but no series problems.
apt-get install nfs-kernel-server && vim /etc/exports
/usr/sbin/exportfs -a service nfs-kernel-server restart service nfs-kernel-server status
To change UID/GID when exporting, use
To use usernames instead of IDs, use
echo N > /sys/module/nfs/parameters/nfs4_disable_idmapping. [serverfault]
UBUNTU AS A CLIENT
apt-get -q install -y nfs-common && mkdir -p /mnt/nfsMountPoint mount -t nfs serverIpOrDomain:/absolute/path /mnt/nfsMountPoint
-o nolockcan be used for
mount, which disables file locking. This setting is occasionally required when connecting to older NFS servers. ref.
mkdir -p /local/nfsMountPoint echo 'nfsServerOrIp:/absolute/path/ /local/nfsMountPoint nfs defaults 0 0' >> /etc/fstab
For Synology NAS, see the official tutorial.
WINDOWS 7 AS A CLIENT
To have write permission, we need to set
userId:groupId the same as server side.
/etc/passwd for server side folder's owner, it is usually
1000:1000 (in decimal base) for the 1st non-root ubuntu user.
Modify window regedit (the win sys service should be started once to have this reg key):
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default] "AnonymousUid"=dword:000003e8 "AnonymousGid"=dword:000003e8
(if the .reg is used after enabling win NFS feature, restart the windows service or reboot, then remount.)
Enable the windows feature "Client for NFS". ref
cmd (NOT powerShell !!!)
mount <serverIpOrDomain>:<absolutePathFolderToShare> Z: # e.g.: mount google.com:/home/abc/theFolder Z:
encoding problem (only in win???)
Description: files created in win with non-ASCII chars will become question marks '?' in linux, also when read again in win.
Solution: no way to solve, unless NFS v4. see super.user
To check nfs versions on server:
To check on linux clinet:
mount -v; nfsstat -m ref
To check on win client: ？？？
The right side drive (Z:) is NFS, which shows wrong space usage, and display speed is much slower than SMB (left side, Y:) when mounted in windows. For space usage, by default, ext2/3/4 filesystems reserve 5% of the space to be useable only by root, see ref.