LinuxQuestions.org
Help answer threads with 0 replies.
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-10-2005, 07:03 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36
The ultimate NFS automount challenge / problem?


I've got a small home network consisting of a couple of laptops, a desktop PC and a server, all running Slackware 10.2 with kernel 2.6.x.
Currently I have all the home directories on the server, NFS mounted from the desktop PC and the laptops. This works great.

The problem is that when I travel and wish to bring my laptop, I have no files as they are stored on the server in my home. Thus I want to move my home directory ( /home/yalla ) to my laptop, but still have the the other users (wife, rest of family) available on /home/wife and /home/dad NFS-mounted from the server. Similarly, I want my /home/yalla (my ~) to be available on the other laptops, desktop and server when I'm home and my laptop is connected to the network, so that others can use my laptop while I'm working on the desktop, still using the files on the laptop.

Question: Is there a way to use an auto-mounter to automatically mount /home/yalla on the other machines from my laptop when trying to access it from lets say the server? And vice versa - when I'm on my laptop and want to copy a file to my wife, can I have the system automatically mount /home/wife next to /home/yalla ?

The only automount setup I have seen does this through NIS/NIS+, and that defies the purpose as I need my laptop to be 100% stand-alone when traveling. If not I can just continue having all the home directories on the server.

Anyone, please?
 
Old 12-10-2005, 08:20 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Been a while since I've played with automounter but:

1) NIS/NIS+ is not directly related to filesystem mounts. It makes common table files available across your network (hosts, passwd, shadow, services etc...) so you don't have to recreate them on each one. The reason you likely see it in automounter discussions is for passwd/shadow so that the user password, UID etc.... on one system will be available on another. It makes account information available but does NOT make the files in the accounts home directory available. So long as you don't mind creating the user in the local /etc/passwd /etc/shadow on each host you don't need NIS/NIS+.

2) If /home is a filesystem itself what you want to do would be very difficult with automounter because in some cases you'd want /home mounted from the server THEN have /home/yalla mounted on top of it but in other cases you'd want /home/yalla by itself because you don't have the server's /home available. I'd suggest using manual mounts if this is the case.
a) On your laptop create a directory such as /home2/yalla.
b) On your laptop under /home WITHOUT /home mounted from server create a symbolic link:
ln -s /home2/yalla /home/yalla
c) On your server under /home create the symbolic link:
ln -s /home2/yalla /home/yalla
d) When at home manually mount /home to your laptop:
mount /home
Because you have the symbolic link within the directory mountpoint on your laptop it will find your home even without /home mounted (of course /home/wife and the other directories won't be available) when you're traveling. Because the symbolic link also exists within the mounted filesystem you'll still have access after you mount it at home. (Users at home will see /home/yalla link when you're not at home but it will simply tell them not found if they try to go there because of course there is no /home2/yalla on the server.)

The reason you can't do automount is that it would always try to mount /home even when you were travelling once you tried to access any subdirectory because that is what is designed to do.

I'd suggest it would be simpler though just to create /home2/yalla and change /etc/passwd on the laptop and other systems to use that as your home directory then setup the server to manually mount /home2/yalla from your laptop and tell your family not to try accessing that while you're gone. (You could setup automounter but if someone in your family tried to access /home2/yalla while you were gone it could cause NFS issues which might slow down commands like df or find that try to access all filesystems.

Last edited by MensaWater; 12-10-2005 at 08:23 AM.
 
Old 12-11-2005, 09:47 AM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
Thank you for the thorough answer!

I'll go for the symlink / manual mount of my home directory when logging in on another PC.

The only challenge I see remaining is how to remember to manually unmount my laptop from the other computers prior to just grabbing it and run when I'm late for a meeting (again!)

-Y1
 
Old 12-11-2005, 11:02 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The unmount command is "umount". If filesystem is mounted as /home2/yalla you'd just type "umount /home2/yalla" on the system that has it NFS mounted (not the laptop). Of course you'd have to do this on each server it was mounted on. You definitely want to be sure to do the umount to avoid the infamous "stale NFS file handles" that cause some of the issues I mentioned with automount. The only sure way to resolve those is the reboot the server that had the NFS mount. They're not usually fatal but they can sure slow things down. (Logins for example usually run a quota check even when you haven't enabled quotas and they'll hang for a while waiting for NFS to timeout when they attempt to check that filesystem's quota.)

If there a multiple servers to unmount from you could create a script on the laptop that does ssh to each to issue the command. You can also set up ssh trusts from the laptop to the servers that prevents you needing to type in the password. You might want to put the script on the server and just make sure you run it from the server before shutting down the laptop.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
not able to automount files in nfs at startup time kool124 Linux - Networking 4 10-03-2005 11:04 AM
its a challenge !! (NFS/FTP/Login) sachinh Linux - General 1 08-17-2005 08:33 PM
Automount NFS from LDAP info not working klnasveschuk Linux - Networking 2 07-26-2005 01:04 PM
automount nfs and smb al_erola Linux - Networking 2 04-27-2003 11:33 AM
NFS - Automount / Security Issues gene_gEnie Linux - Networking 0 02-08-2002 03:05 PM

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

All times are GMT -5. The time now is 08:03 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