Local mounts without NFS server
I'm new to this list but I've looked through the past few months in the archive and didn't see anything similar. I've been using autofs for ages to manage home directories and third party applications across my network. Now I've installed a new machine with Fedora Core 2 test 3 which is my first experience with autofs4. Unfortunately it looks like one component of my setup isn't working or is no longer supported.
We have various pieces of third party software under /usr/local, which is an automount map. Some applications are frequently used, so there is a local partition on each machine that has enough disk called /cache which is kept updated via rsync. An entry in /etc/auto_usr_local looks like:
matlab localhost:/cache/pkg/matlab-6.5.1
For years that entry has caused autofs to set up a bind mount so that /usr/local/matlab is bound to /cache/pkg/matlab-6.5.1. This has worked on all clients.
Under FC2T3/autofs-4.1.2-2 this doesn't work _unless_ I export /cache via NFS. This is what I see in the logs before the export with '-v' passed to automount:
Apr 29 14:18:37 compute08 automount[5140]: attempting to mount entry /usr/local/matlab Apr 29 14:18:37 compute08 automount[5158]: mount(nfs): no host elected Apr 29 14:18:37 compute08 automount[5158]: failed to mount /usr/local/matlab
After I do the export everything works fine, but NFS isn't actually used for the mount. From /proc/partitions:
/dev/vg0/cache /usr/local/matlab ext3 rw 0 0
That's good, but why did I have to do the export? The bind would succeed without it, so I'm not sure why it's necessary.
Thanks,
- J<
Ian Kent
maintainerQuoted 9 lines · Jason L Tibbitts III
Under FC2T3/autofs-4.1.2-2 this doesn't work _unless_ I export /cache via NFS. This is what I see in the logs before the export with '-v' passed to automount:
Apr 29 14:18:37 compute08 automount[5140]: attempting to mount entry /usr/local/matlab Apr 29 14:18:37 compute08 automount[5158]: mount(nfs): no host elected Apr 29 14:18:37 compute08 automount[5158]: failed to mount /usr/local/matlab
Quoted 7 lines
After I do the export everything works fine, but NFS isn't actually used for the mount. From
/proc/partitions:
/dev/vg0/cache/usr/local/matlabext3 rw 0 0That's good, but why did I have to do the export? The bind would succeed without it, so I'm not sure why it's necessary.
Cool. Good bug report.
An unexpected side effect of the replicated server code.
I'll investigate and fix it.
Ian
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"IK" == Ian Kent <[email protected]> writes:
IK> An unexpected side effect of the replicated server code.
Ah, I see how it would interfere, given that all of the hosts are pinged (via RPC) and localhost fails since it doesn't export anything.
IK> I'll investigate and fix it.
Thanks. Could you just call is_local_addr and if so check that the path exists instead of doing the RPC ping? That way you could use localhost and remote hosts as alternate servers. (I could use this for machines without enough disk to cache things.)
- J<
Ian Kent
maintainerQuoted 6 lines · Jason L Tibbitts III
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"IK" == Ian Kent <[email protected]> writes:
IK> An unexpected side effect of the replicated server code.
Ah, I see how it would interfere, given that all of the hosts are pinged (via RPC) and localhost fails since it doesn't export anything.
I shouldn't be pinging local addresses at all.
Quoted 7 lines
IK> I'll investigate and fix it.
Thanks. Could you just call
is_local_addrand if so check that the path exists instead of doing the RPC ping? That way you could use localhost and remote hosts as alternate servers. (I could use this for machines without enough disk to cache things.)
I shouldn't need to do that either.
This is a programming error. I'll fix it tonight I hope.
Ian
[email protected]
maintainerQuoted 14 lines · Ian Kent
Quoted 6 lines · Jason L Tibbitts III
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"IK" == Ian Kent <[email protected]> writes:
IK> An unexpected side effect of the replicated server code.
Ah, I see how it would interfere, given that all of the hosts are pinged (via RPC) and localhost fails since it doesn't export anything.
I shouldn't be pinging local addresses at all.
Quoted 3 lines
IK> I'll investigate and fix it.
Quoted 8 lines
Quoted 4 lines
Thanks. Could you just call
is_local_addrand if so check that the path exists instead of doing the RPC ping? That way you could use localhost and remote hosts as alternate servers. (I could use this for machines without enough disk to cache things.)I shouldn't need to do that either.
This is a programming error. I'll fix it tonight I hope.
I believe this patch fixes the problem. Please test and let me know.
modules/mount_nfs.c.local renamed from modules/mount_nfs.c +7 -6
@@ -192,13 +192,14 @@ p = next; } - if (local) { + if (local) + alive = 1; + else alive = rpc_ping(p, sec, micros); - if (alive) { - winner = p; - break; - } - local = 0; + + if (alive) { + winner = p; + break; } } }
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"r" == raven <[email protected]> writes:
r> I believe this patch fixes the problem. Please test and let me r> know.
I tweaked the RPM specfile, rebuilt and installed the resulting package. My problem has been resolved. Thanks!
- J<
Jason,
I like your idea about keeping the /cache up to date via rsync. What other maps, mounts or symlinks do you have to keep this working? I'd be interested in knowing how to set this up. :)
For example, for hosts that don't have a /cache filesystem, do they have a separate auto_usr_local map? Do all your machines that have /cache always mirror the same directories so you only maintain one /etc/auto_usr_local file?
Thanks.
/Brian/
Quoted 44 lines · Jason L Tibbitts III
I'm new to this list but I've looked through the past few months in the archive and didn't see anything similar. I've been using autofs for ages to manage home directories and third party applications across my network. Now I've installed a new machine with Fedora Core 2 test 3 which is my first experience with autofs4. Unfortunately it looks like one component of my setup isn't working or is no longer supported.
We have various pieces of third party software under
/usr/local, which is an automount map. Some applications are frequently used, so there is a local partition on each machine that has enough disk called /cache which is kept updated via rsync. An entry in/etc/auto_usr_locallooks like:matlab localhost:/cache/pkg/matlab-6.5.1
For years that entry has caused autofs to set up a bind mount so that
/usr/local/matlabis bound to /cache/pkg/matlab-6.5.1. This has worked on all clients.Under FC2T3/autofs-4.1.2-2 this doesn't work _unless_ I export /cache via NFS. This is what I see in the logs before the export with '-v' passed to automount:
Apr 29 14:18:37 compute08 automount[5140]: attempting to mount entry /usr/local/matlab Apr 29 14:18:37 compute08 automount[5158]: mount(nfs): no host elected Apr 29 14:18:37 compute08 automount[5158]: failed to mount /usr/local/matlabAfter I do the export everything works fine, but NFS isn't actually used for the mount. From
/proc/partitions:
/dev/vg0/cache/usr/local/matlabext3 rw 0 0That's good, but why did I have to do the export? The bind would succeed without it, so I'm not sure why it's necessary.
Thanks,
- J<
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs
Signature · 4 lines
Brian Long | | |
Americas IT Hosting Sys Admin | .|||. .|||.
Cisco Linux Developer | ..:|||||||:...:|||||||:..
Phone: (919) 392-7363 | C i s c o S y s t e m sQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"BL" == Brian Long <[email protected]> writes:
BL> I like your idea about keeping the /cache up to date via BL> rsync.
Well, it's actually a hack but it works well enough.
BL> What other maps, mounts or symlinks do you have to keep this BL> working?
Just to /etc/auto_usr_local files, one for the hosts with /cache and one without. These days, though, every machine has enough disk to cache what it needs. That wasn't the case back when I put this together.
BL> For example, for hosts that don't have a /cache filesystem, do BL> they have a separate auto_usr_local map?
Yes, the hosts pull what they need from a server, and hosts without /cache pull a different auto_usr_local map. I guess if I used failover I wouldn't even have to do that, but I'm not sure if that's supported far enough back.
BL> Do all your machines that have /cache always mirror the same BL> directories so you only maintain one /etc/auto_usr_local file?
Yes, that makes it simple. But it wouldn't be too hard to pull down directories until the disk gets too full and either use failover or autogenerate /etc/auto_usr_local depending on what you could fit. I don't have enough third-party applications to make that worthwhile. (Just Mathematica, Matlab, Maple, the Portland Group compilers and some locally compiled stuff that I really should turn into RPMs.)
- J<
[email protected]
maintainerQuoted 15 lines · Jason L Tibbitts III
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"BL" == Brian Long <[email protected]> writes:
BL> I like your idea about keeping the /cache up to date via BL> rsync.
Well, it's actually a hack but it works well enough.
BL> What other maps, mounts or symlinks do you have to keep this BL> working?
Just to
/etc/auto_usr_localfiles, one for the hosts with /cache and one without. These days, though, every machine has enough disk to cache what it needs. That wasn't the case back when I put this together.
Quoted 7 lines
BL> For example, for hosts that don't have a /cache filesystem, do BL> they have a separate
auto_usr_localmap?Yes, the hosts pull what they need from a server, and hosts without /cache pull a different
auto_usr_localmap. I guess if I used failover I wouldn't even have to do that, but I'm not sure if that's supported far enough back.
4.1.1 I think.
It's a mount time check only. There is no dynamic failover.
The umounting logic needs to made smarter as well.
Ian