Using NFS to Share Files on QNAP Between OS X and Linux


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 QNAPSynology 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

  1. About.com: Linux / Unix Command: exports
  2. Apple: OS X Man Pages: EXPORTS(5)
  3. Apple: OS X
  4. Christian Schneider: HOWTO setup a small server: NFS Server (Network File System)
  5. Computer Hope: Netmask
  6. Facebook: QNAP Geek
  7. Krischan Jodies: IP Calculator
  8. Linux.org
  9. nfs.sourceforge.net: 3. Setting Up an NFS Server
  10. QNAP
  11. QNAP: QTS
  12. Samba
  13. StackExchange: Unix & Linux: How to configure a fixed user ID on an NFS server?
  14. Synology
  15. Tech Republic: Mounting NFS volumes in OS X
  16. Wiki: Internet Protocol
  17. Wiki: Lightweight Directory Access Protocol
  18. Wiki: Network File System
  19. You Mac / Linux Guy: Automount NFS in OS X
  20. 鳥哥的 Linux 私房菜: 第十三章、檔案伺服器之一:NFS 伺服器
  21. 鳥哥的 Linux 私房菜: 何為同一網段之 IP ,及 netmask 的定義與切割子網的方法說明

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.