Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-10-2005, 07:03 AM
|
#1
|
Member
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641
Rep:
|
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?
|
|
|
12-10-2005, 08:20 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
|
|
12-11-2005, 09:47 AM
|
#3
|
Member
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641
Original Poster
Rep:
|
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
|
|
|
12-11-2005, 11:02 AM
|
#4
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
|
|
All times are GMT -5. The time now is 08:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|