Tuesday, October 23, 2012

Mount NetApp NFS volume to Linux server (for Windows people)

I recently had to update the disk firmware on a NetApp filer running NFS only (CIFS would allow Windows/NTFS access but needs a license and setup, and certain versions of ONTAP does not recommend running both NFS and CIFS) and after reading the documentation, I realized that the doc fell short for those that are not as Linux/Unix savvy and it inspired me to write something about it here.

The gist of the upgrade for a NetApp filer is rather simple, mount the /vol/vol0/ and browse to /etc/disk_fw and copy over thew new firmware bits.....but if you haven't mounted a NFS volume to a Linux server before, you are likely searching Google right now chanting Whiskey Tango Foxtrot as you may have come across a link to this blog here. Time to fill in the gaps on that doc now;

1.) You are going to need a Linux box

I virtualize all of my servers and I happen to have a Fedora 13 VM running and that is what I used to mount the NFS volume to the Linux server. If you don't have a Linux server but have vitualization technology available to you, there are pre-made VMs called appliances and there are many Fedora builds available. If you are the hardware sort of guy or gal, I'll wait, go ahead and build your dinosaur of a physical server while I drink some coffee.

2.) Getting the NetApp NFS volume mounted to Linux (in my case Fedora 13)

You have likely already looked at several webpages and have an idea of what the syntax maybe but just not connecting? No worries, I will explain in full here. First you need to make sure that the Fedora server's /mnt directory has a valid sub directory for the NetApp volume to mount to. The Mount command is Mount [file type] [from where:what directory] [to where] and the [to where] parts needs an existing path. I used WinSCP for an easy GUI browse of the Fedora server and when you first log in, hit the drop down that reads 'root' and go to /[root] which will re-populate the right side split window with more folders and each of those folders is called a directory. Go into the one labeled 'mnt' than press F7 to create a new directory and call is netapp.

Now that you have created the /mnt/netapp directory, you are ready to mount the filer. I use putty to SSH to the Fedora server and here is the command once you have logged in;

mount -t nfs [IP of your netapp filer]:/vol/vol0 /mnt/netapp

The above command declares the file type as NFS by '-t nfs' and [IP of your filer]:/vol/vol0 is the from where:what directory on the NetApp filer and the /mnt/netapp defines what directory on the Fedora server that this volume will be presented to. As a note of clarification, there should be no space between your filer IP and the : above, (e.g. 192.168.1.100:/vol/vol0). As for why /vol/vol0? That's the default on the NetApp filer's directories of where the /etc folder is, which we will be getting to shortly.

To make sure that the NetApp volume mounted, browse the directory by entering ls /mnt/netapp/etc and if an output shows a bunch of files and directories, congratulations, you have mounted the volume successfully as you are viewing the /etc directory on the NetApp filer that has now been mounted to the /mnt/netapp directory on your Fedora server.

For sake of ease, since I already have WinSCP running, I browse to /mnt/netapp/etc/disk_fw and copy over the necessary disk firmware files using WinSCP. From here on out, use the NetApp disk firmware upgrade instructions. Once you have everything you need, run the following command to unmount the NFS volume;

umount -a -t nfs

There are methods to mount the NFS volume directly to Windows using third party software such as NekoDrive but had issues when copying over data as it seems to retain the NFS volume in memory and will require a high memory machine to be able to complete write operations without error. If you are running ONTAP version 8.1 or later, I have come across a blog post by Cosonok regarding how to enable access directly from WinSCP but since I do not have that ONTAP version available to test, I haven't confirmed it's functionality (I can tell you that the method listed on his blog does not work for ONTAP version 7.3.2). The method that I listed works on Fedora and Red Hat servers (tested Fedora 13, 15, and RHEL 6) and if you use other versions of Linux, keep in mind that some of the syntax may change (instead of mount, it may be mnt, mt, etc). Hope this helped solve your NFS mounting issues.