Sep 05

Arghhhh!  Apple has done it again.  They’ve changed the manner in which NFS shares are mounted.  Back in 10.5 Leopard, the Directory Utility was used to mount shares.  In 10.6 Snow Leopard the Disk Utility program is the place where this is done.  That wouldn’t have been so bad except for the fact that the upgrade from 10.5 to 10.6 wiped out my NFS mount definitions. Which forced me to learn this new procedure:

Fire up Disk Utility and select File -> NFS Mounts…   Doing so will lead to a very similar dialog as in the 10.5 Directory Utility.  Here’s the list of mounts on my client:

List of NFS Mounts

You can click the “+” to add a new mount. In the following case, I clicked on the pencil to edit an existing mount:

Add NFS Share

I’ve been using the “-P” advanced option to access the shares on our QNAP NAS device. See Mac OS X mount_nfs man page for details.

Adding Shares to Finder

The trick to adding a convenient folder to Finder’s Places folder is to ensure that you create a directory containing the mount points. For example, I defined my mount points under /Volumes/network/.

But you might not see /Volumes and your containment directory when you look at the hard disk in Finder. Use “command-shift-G” to bring up a dialog such that you can go directly to the directory of interest. In my case I went to /Volumes and simply dragged the “network” containment folder over to the Places folder. Voila! Now whenever I want to access my NFS shares, I simple click on the “network” folder in Finder. This is how I had it arranged in 10.5 as well.

As in 10.5, the shares will automatically be mounted as you start your system. The day-to-day experience with this approach was pretty good. Even when our MacBook Pro wasn’t attached to our home network, the machine does not experience any noticeable hangs or hiccups because of the unavailability of the NAS server.

Tagged with:
Aug 25

We’re running MySQL on our low power home server system to support both our home monitoring system based on thermd and TNG Genealogy, a PHP-based web site application.  Since the internal solid state device (SSD) that acts as the hard drive for the home server has limited capacity (8 GB), I wanted to modify the MySQL configuration to maintain the databases on our QNAP NAS server.  Doing so provides us with lots of storage space and automatic backups via our multi-disk backup scheme. The only downside of the approach might be increased latency of database operations due to the use of NFS to access the database files.

Figuring out how to modify the configuration of MySQL to stop using /var/lib/mysql/ and to use a newly mounted share was easy.  After creating a mysql account and group on the NAS server and forcing the ids to be the same as used on the home server system, I tried to start MySQL.  However, I ran into a permissions problem:

Aug 25 22:21:14 home-server mysqld_safe[24585]: started
Aug 25 22:21:14 home-server kernel: [645095.493657] audit(1251256874.809:14): type=1503 operation="inode_create" requested_mask="w::" denied_mask="w::" name="/mnt/network-disk/database/home-server.lower-test" pid=24587 profile="/usr/sbin/mysqld" namespace="default"
Aug 25 22:21:14 home-server mysqld[24588]: 090825 22:21:14 [Warning] Can't create test file /mnt/network-disk/database/home-server.lower-test
Aug 25 22:21:14 home-server kernel: [645095.497234] audit(1251256874.809:15): type=1503 operation="inode_create" requested_mask="w::" denied_mask="w::" name="/mnt/network-disk/database/home-server.lower-test" pid=24587 profile="/usr/sbin/mysqld" namespace="default"
Aug 25 22:21:14 home-server mysqld[24588]: 090825 22:21:14 [Warning] Can't create test file /mnt/network-disk/database/home-server.lower-test
Aug 25 22:21:14 home-server kernel: [645095.586722] audit(1251256874.899:16): type=1503 operation="inode_permission" requested_mask="rw::" denied_mask="rw::" name="/mnt/network-disk/database/ibdata1" pid=24587 profile="/usr/sbin/mysqld" namespace="default"
Aug 25 22:21:14 home-server mysqld[24588]: 090825 22:21:14  InnoDB: Operating system error number 13 in a file operation.
Aug 25 22:21:14 home-server mysqld[24588]: InnoDB: The error means mysqld does not have the access rights to
Aug 25 22:21:14 home-server mysqld[24588]: InnoDB: the directory.
Aug 25 22:21:14 home-server mysqld[24588]: InnoDB: File name ./ibdata1
Aug 25 22:21:14 home-server mysqld[24588]: InnoDB: File operation call: 'open'.
Aug 25 22:21:14 home-server mysqld[24588]: InnoDB: Cannot continue operation.
Aug 25 22:21:14 home-server mysqld_safe[24595]: ended

Although all of the filesystem ownership and permissions were set properly, MySQL wouldn’t start.  It turns out that there’s an “apparmor” facility in Ubuntu that has a specific profile or configuration for MySQL.  This profile specifies the files that MySQL can access.  The standard path of /var/lib/mysql/ was present, but obviously the path of my new database share was not.  Once I modified the config file under /etc/apparmor.d/ and restarted apparmor, I was able to start MySQL.

Tagged with:
Nov 05

Since I recently reconfigured our Macs to use NFS to access data housed on our home NAS server, it was time to start using NFS from Ubuntu to do the same. Functionally, the use of CIFS to access the QNAP NAS server worked without a hitch, but I knew we weren’t getting the best performance by using CIFS.  I covered the CIFS set up in an earlier blog entry.  In this example, I had to configure our new home server system to access our NAS server.

In the following excerpt from an Ubuntu system’s /etc/fstab file, “network-disk” is the host name of the NAS server.

network-disk:/share/HDA_DATA/Qdownload /mnt/network-disk/downloads nfs _netdev,auto,user 0 0
network-disk:/share/HDA_DATA/backup /mnt/network-disk/backup nfs _netdev,auto,user 0 0
Tagged with:
Oct 26

I recently acquired a MacBook Pro 15″ laptop for work.  What a nice machine!

We’ve been using SMB to connect our other Mac and Linux computers in the house to our NAS server, but I wanted to give NFS another try given that it’s much better performing.  The QNAP NAS server had a bug in that its QRAID-1 feature wouldn’t work properly when NFS is in use.  Since that issue was present in the QNAP software more than a year ago, I am crossing my fingers that they have fixed it since then.

Setting up access to NFS shares on Mac OS X has become a lot easier with 10.5 (Leopard). I used the following advice to get my MacBook set up properly:

NFS on Mac OS X 10.5

I ended up modifying my Unix user ID on the NAS server to match the ID used on the MacBook such that permissions and ownership would work properly.  As I retrofit our iMac to access the NAS server via NFS, I’ll need to rework our other user IDs too.  Using “chown -R userid:groupid” is a godsend on the NAS server to make these adjustments.

Tagged with:
Nov 17

Updated November 5, 2008:  Since several of our Macs are running Mac OS X 10.5 in which it is simple to set up access to NFS shares and a prior bug in the QNAP NAS server implementation of NFS and its QRAID-1 backup feature was fixed, we’ve switched to using NFS to access the NAS server. Therefore the information below is out of date.

Earlier this week we finally installed our new NAS server. We published a blog entry describing our initial set up experience. One of the next tasks was to get our Mac OS laptop configured to automatically mount the shares from the NAS server.

A key requirement for share access from our clients is that we don’t want to repeatedly execute commands to mount and access the shares. Ideally, once a folder of interest is accessed, the supporting share would be automatically mounted. Continue reading »

Tagged with:
preload preload preload