Setting Up The NAS!
DISCLAIMER! This document is nothing more than the musings of the author as he attempts to perform the stated tasks. Conclusions and approaches
may very well be incorrect, inefficient, or otherwise outside of professionally accepted best practices. Use this document at your own risk! In this
document, screen outputs will be presented in green. Where keyboard input is required, the prompt will be in bolded red. # means you should be at the
super user prompt, $ means you should be at an unprivileged user prompt. Do not include these prompts in your input! The command to be typed will be
shown in blue.
# ls -al
means you type ls -al at the super user prompt.
My NAS is a Thecus N5200 5-bay nas appliance. I have 5x2tb drives set up in a raid5 configuration. The result is a 7.1tb nas which I call solnas and have assigned an ip address of 192.168.1.15. For it to work, the host file (/etc/hosts) needs the entry, so ensure it is there by pinging the box.
# ping solnas
solnas is alive
The NAS does not support NFSv4, at least I can't get it to work. So I edited /etc/default/nfs and modified the following line:
#NFS_SERVER_VERSMAX=4
to read
NFS_SERVER_VERSMAX=3
(uncommented the line and changed the number at the end from 4 to 3), which forces the system to operate on NFSv3.
The I restarted the nfs client:
# svcadm restart nfs/client
We created a share on the NAS called solab and will attempt to mount it on our solaris box to /solab. So
# mkdir /solab
The next step is setting up an automount. Automounts are cool because they automatically mount when you migrate to the mountpoint. This is useful for home directories, but we will use it for other mounts as well.
Now we need to edit / create two files. auto_master, auto_direct. (We will discuss auto_home later).
AUTO_MASTER
edit /etc/auto_master and put the following lines in it.+auto_master
/net -hosts -nosuid,nobrowse
/home auto_home -nobrowse
/- auto_direct -nobrowse
AUTO_DIRECT
Now edit /etc/auto_direct and put the following in it:/solab solnas:/raid0/data/SOLAB
The auto_direct file must be chmod'd to 644. If you set executable permissions you will get a permission denied when attempting to navigate to that directory!You can type # showmount -e host to get a list of the available directories from that host!
The final part is to restart the autofs process
# svcadm restart autofs
and then navigate to the mountpoint
# cd /solab
# ls
drwxrwxrwx+ 5 99 100 4096 Oct 12 2012 .
drwxr-xr-x 27 root root 31 Oct 11 23:50 ..
drwxrwxrwx+ 2 root root 4096 Oct 12 2012 Documentation
drwxrwxrwx+ 3 root root 20 Oct 11 17:43 Solaris_10
drwxrwxrwx+ 3 root root 20 Oct 11 18:02 System_files
You can test the automount function by logging out (which should unmount /solab), logging back in, and doing a mount command. Notice the solnas:/ mount is not there, change into the /solab directory and do the mount again and you will see it automatically mounted.