LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-12-2013, 12:32 PM   #1
Cr45h
LQ Newbie
 
Registered: Sep 2008
Location: UK
Distribution: Debian
Posts: 10

Rep: Reputation: 0
Question NFS Connection issue to NAS


Hi guys,

I don't know if this is the proper section, feel free to move the thread in a more appropriate one if needed.

Anyway, I'm writing here because I have a strange behavior in my Linux server.

Scenario: Linux VM running debian and NAS with a NFS share available.

What I did is to create a mountpoint on the debian box and then use this command to mount the NFS share:

Code:
mount -o soft,intr,rsize=8192,wsize=8192 xxx.xxx.xxx.xxx:/nas_share /nas
The command worked perfectly, and I started using the NAS share to store some files.

Now, I was looking after this a couple of weeks later, discovering that the NFS share is still mounted and perfectly reachable/writable and so on, BUT if I do

Code:
cat /etc/mtab
cat /etc/fstab
mount
df -h
whatever to show the mount point, the one who belongs to the NFS share does not appear.

How can this be possible?

The command to umount the share does not work (thinking that maybe just umounting and remounting it will solve this small issue) instead I'm stuck at this point because it's really strange to me that I cannot see where this mount is on the filesystem.

If there's some information missing, let me know.


THanks,
Cr45h
 
Old 12-12-2013, 05:28 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Did you add an entry for the share in your fstab file? From what you posted it just looks like you manually mounted the share.

How do you know the NAS is reachable/writeable? Can you look at the files on the NAS via a web interface or ssh, ftp etc and see that they are actually written to it?

Did you shut down the VM or computer? Have both been running continuously? A mount point is just a directory. If the share is not mounted then the files will be written to the VMs disk and not the NAS share.
 
Old 12-13-2013, 06:58 AM   #3
Cr45h
LQ Newbie
 
Registered: Sep 2008
Location: UK
Distribution: Debian
Posts: 10

Original Poster
Rep: Reputation: 0
Well,
At the moment there's no entry on fstab to have it mounted at every reboot, I was planning to do it as a second step.

The NAS is reachable/writeable because if I ls -l or cd into the /nas folder I can see the files; moreover, the share is managed by a third party web app that writes the files there so it works.

Also doing
Code:
showmount -e xxx.xxx.xxx.xxx
I can see the NAS shares and reach mine; the same from the NAS web interface.

It's just strange to me that everything seems working as expected, apart that I'm not able to list the NFS mounted drive on the linux box.

Actually, I'm not even able to do "umount /nas".


EDIT: Wait a sec.. I had a look at the nas shared folder from the NAS web interface... you're right, there're differences... So do you think he's just writing on the VM disk instead of the NAS one?
Even if the directory is supposed to be the NAS mountpoint?


That's it.

Last edited by Cr45h; 12-13-2013 at 07:06 AM. Reason: added informations
 
Old 12-13-2013, 08:36 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
As stated /nas is just a directory. If the share is not mounted the files are written to the local file system vs the NAS device itself. Just because you can ls or cd into the /nas folder does not mean the share is mounted or the files seen are actually located on the NAS device. For example if you copy a file to /nas and check the / file system for a change in size then if it increases then the share isn't mounted.

If you can write files to /nas and see them via the web app at this very moment in time then I will submit to say the share is still mounted.
 
Old 12-13-2013, 09:22 AM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
From the sound of it, your VM has been rebooted sometime between when you originally ran the mount command and now. From that moment on, all writes to /nas went onto the VM's local storage, since the NFS share was no longer mounted there.
 
Old 12-13-2013, 11:16 AM   #6
Cr45h
LQ Newbie
 
Registered: Sep 2008
Location: UK
Distribution: Debian
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks michaelk for the suggestion.

The problem now is "how can I be sure that the /nas folder is actually the mountpoint of my NFS shared drive instead of the local system?"

I'll have a look on the forum/internet before submitting a possible other thread. :P

@suicidaleggroll: no, it's impossible that the VM restarted because of 2 factors:

1- is monitored by Nagios, so if there was a restart (e.g. a connection loss to the VM) I would receive an email.
2- is LVM encrypted, so without the encryption key it won't restart anyway (that ends on point 1).
 
Old 12-13-2013, 12:17 PM   #7
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
look into autofs instead of using fstab for your mount point. what happens is that every time you access the /nas directory it will automagically mount the share before you have access to it, therefore you know the files are sent to the NAS, and not stored local like they are now.
 
Old 12-13-2013, 12:28 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by Cr45h View Post
The problem now is "how can I be sure that the /nas folder is actually the mountpoint of my NFS shared drive instead of the local system?"
One way is to store your data in a subdirectory, rather than on the root of the NFS share.

If you can't access the subdirectory to read/write your data, then the NFS share isn't mounted, and you're just looking at the empty mount point on the local system.
 
  


Reply

Tags
debian, nfs mount network



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] NFS vs SMB on NAS gmathisz Linux - Networking 6 12-09-2013 07:22 PM
NFS versus NAS brian00 Linux - Newbie 2 02-25-2012 01:14 PM
Issue to access NFS share which is shared on HP NAS box chirag_linuxforum Linux - Networking 3 08-06-2010 05:48 PM
NAS share with NFS xhimi Linux - Server 0 02-21-2008 09:51 AM
NFS Connection Issue gamradtk Linux - Networking 0 09-10-2005 11:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration