I choose to use Network File System aka NFS to share files between OS X and Linux because it’s much faster than Samba. But there is one more thing I need to handle: file and folder permissions.
Allow Connection to NAS
QTS on QNAP is a graphical web interface for easier management.
First, you need to add IP address in NFS host access list in [Control Panel] → [Privilege Settings] → [Shared Folder] and allow for read / write. You may use IP with Netmask to specific range with the same permission. Thanks for correction by Li-chih Wu in Facebook Group: QNAP Geek.
For example, if you want all IP between 192.168.1.1 to 192.168.1.254 with the same permission, use 192.168.1.1/24. Another is all IP between 192.168.1.5 to 192.168.1.6 with the same permission, use 192.168.1.5/29. Netmask on Computer Hope is a very detail explain and IP Calculator by Krischan Jodies may calculate for you.
Mounting NFS volumes in OS X on Tech Republic is a good post for first-time OS X user. Automount NFS in OS X from Your Mac / Linux Guy explains with Lightweight Directory Access Protocol aka LDAP.
At first, I leave Squash options as default NO_ROOT_SQUASH. But I notice folder owner created on Linux and OS X are different, files created on one cannot be edit or delete by another.
drwxr-xr-x 5 1000 everyone 4096 Jun 13 19:01 Linux/ drwxr-xr-x 2 501 20 4096 Nov 13 19:01 Mac/
File Permission and Squash Option
Because I want to have full access on files and folders on QNAP, I have to set Squash options to ALL_SQUASH to map all client access to anonymous user according to Linux / Unix Command: exports on About.com.
Because I also have to choose guest as UID (no other options), it means to map as guest user on QTS.
drwxr-xr-x 2 guest guest 4096 Nov 13 21:42 Linux/ drwxr-xr-x 13 guest guest 4096 Nov 13 21:43 Mac/
Notes
This post only apply to QTS on QNAP. Synology needs special and manual configurations. If you are using OS X as your NFS server, please refer to EXPORTS(5) on OS X Man Pages.
Reference
- About.com: Linux / Unix Command: exports
- Apple: OS X Man Pages: EXPORTS(5)
- Apple: OS X
- Christian Schneider: HOWTO setup a small server: NFS Server (Network File System)
- Computer Hope: Netmask
- Facebook: QNAP Geek
- Krischan Jodies: IP Calculator
- Linux.org
- nfs.sourceforge.net: 3. Setting Up an NFS Server
- QNAP
- QNAP: QTS
- Samba
- StackExchange: Unix & Linux: How to configure a fixed user ID on an NFS server?
- Synology
- Tech Republic: Mounting NFS volumes in OS X
- Wiki: Internet Protocol
- Wiki: Lightweight Directory Access Protocol
- Wiki: Network File System
- You Mac / Linux Guy: Automount NFS in OS X
- 鳥哥的 Linux 私房菜: 第十三章、檔案伺服器之一:NFS 伺服器
- 鳥哥的 Linux 私房菜: 何為同一網段之 IP ,及 netmask 的定義與切割子網的方法說明