LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   NFS auto mounting question (https://www.linuxquestions.org/questions/debian-26/nfs-auto-mounting-question-813852/)

radiodee1 06-13-2010 07:52 AM

NFS auto mounting question
 
Hi,

I have a simple network set up that allows me to share a folder on a particular computer via NFS. I don't want this computer to remain on all the time. Is there a way to have the other computers on the network detect when this computer is up and running and then mount the NFS share automatically? This is the sort of thing that happens automatically when, for example, you plug in an external USB drive, but I don't know how to make it work for this situation. I know very little about NFS in general. I know if you put the reference to the folder in your fstab file you either have to denote it as automatically mounted at boot time, or you have to make it user mountable. I would really like it to mount on its own (and maybe even put an icon on the desktop, though that's not strictly necessary). Is this even possible? Thanks.

Simon Bridge 06-13-2010 08:23 AM

Quote:

is up and running and then mount the NFS share automatically?
Short answer - no.
Long answer - it depends on the exact situation and how much work you want to do.

What I used to do was supply a launcher for a script that allows a user to connect to (mount) the share. It would include ways to handle the error if the server was offline. One could run that script periodically ... inefficient.

How much trouble do you want to go through?

If you want a computer to travel, and share a directory to a network, it is usual to share via SAMBA. For all it's quirks, windows networking is good at this.

If you need production style file-sharing then you are looking at adding dedicated server boxes, doing your own DNS and such stuff. NFS is good at that.

But the exact method actually depends on the exact problem you are trying to solve. Make sure that the solution you are trying is actually appropriate for your problem.

bryanl 06-13-2010 10:16 AM

One way to do approach this is with autofs. That mounts shares only when they are accessed. If the share is not there, it will time out. The leaves it to the user to know when it is appropriate to access the share and getting a timeout if he doesn't take heed.

You might be able to use this with a script that pings the server on occasion and sets up a desktop icon or something if it gets a response or deletes it when it doesn't as a user notification thing.

But I find it usually works to just let the user decide because in small SOHO type environments they usually know when things are turned off and not available. (they learn to pay attention!)


All times are GMT -5. The time now is 07:42 PM.