Monday, March 21, 2011

Fun with NFS Mount

This is just an ongoing saga for me. Nothing is easy. I'm pretty sure there is a great quote for that.

After my ORA-27054: NFS file system where the file is created or resides is not mounted with correct options issues last night (this morning), they just keep coming.

After running the mount command and then starting the backup process, I let it go until this morning. When I checked, it was complete. Yeah.

Checking the System Resource Monitor though, showed differently. I had less space than I did when I started (and quickly approaching no space). Further investigation showed that the mount command didn't work, at all. It didn't fail either though, so I assumed (again, I know) all was right in the world.
[root@medicaid oradata]# umount /media/test
umount: /media/test: not mounted
Not good.
[root@medicaid oradata]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw,size=7g)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
data on /media/sf_data type vboxsf (gid=501,rw)
exp on /media/sf_exp type vboxsf (gid=501,rw)
It's not listed. The ls command displayed the files...but they weren't on the share.

So I started to remove items from the mount command ending up with this:
[root@medicaid media]# mount -t nfs oraclenerd:/media/data_2/files/oradata/TESTING /media/test
mount: mount to NFS server 'oraclenerd' failed: Connection refused.
Ah, look at that, an error. Sweet. Where was that before? What did I do wrong?

After a bit of looking around, I found this Ubuntu guide on setting up NFS.

Looks like I was missing the nfs-kernel-server package. NFS = Network File System. I'm slow.

From the introduction of the How To document:
NFS (Network File System) allows you to 'share' a directory located on one networked computer with other computers/devices on that network. The computer 'sharing' the directory is called the server and the computers or devices connecting to that server are called clients. The clients 'mount' the shared directory, it becomes part of their own directory structure.

NFS is perfect for a NAS (Networked Attached Storage) deployment in a Linux/Unix environment. It is a native Linux/Unix protocol as opposed to Samba which uses the SMB protocol developed by Microsoft. The Apple OS has good support for NFS. Windows 7 has some support for NFS.

Sounds like what I am trying to do.

Load the package, configure the export file with the following:
/media/data_2 medicaid(rw,sync,no_subtree_check)
Then run the original mount command.
[root@medicaid media]# mount -o rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize=32768,actimeo=0 -t nfs 
oraclenerd:/media/data_2/files/oradata/TESTING /media/test
[root@medicaid media] touch test/text.txt
File created.


Vijay Chinnasamy said...

One of the lessons leart from my RHCE Exam is this. Before we start using any of the "server software stuff", we should install all the relevant rpm packages through yum. This is relevant for DNS, Apache, NFS, Samba etc.

I believe, it is good in a way, only install the relevant packages in the server. Nothing more than that.

Great post. Good lessons learnt.

Vijay Chinnasamy

oraclenerd said...

Thanks Vijay.

At this point, I don't know what I don't know. Most of this is just trial and error (playing).

I'm with you definitely...install only what you need.


Clever Idea Widgetry said...

You have data files accessed via NFS mounts? yuck.

oraclenerd said...

no data files...i was just trying to move the backups off the VM because i was running out of space.