Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

We have a (small) lan of linux boxes running cross mounted directories where in each host has the others mounted as hostname:/ on /hostname.

So for completeness, each machine could also have itself done-up as /machine -> /

What, if anything, is the pitfall of doing this?

share|improve this question
    
Are you NFS mounting? Hard or soft mounts? –  Darren Hall Dec 10 '09 at 0:32

2 Answers 2

up vote 2 down vote accepted

Doing a symlink for the local machine should be fine, and should help any scripts that need machine-specific located files. You might also create a /self to have a generic name that always points to whatever is the machine you are on.

I hope you are using soft mounts or something similar so that one broken machine doesn't kill all the others.

share|improve this answer
    
If you want "the current machine", just use /. That's available without any tricks... –  Peter Cordes Dec 10 '09 at 2:53
2  
Yes, but once you are rolling scripts with a naming scheme of /<machine>/path/to/file, you often need to have the extended name in the path, even when pointing to the local maching. –  Shannon Nelson Dec 11 '09 at 1:06

Don't put the mounts in /, put them in /net. (in fact, install autofs, and enable /etc/auto.net in /etc/auto.master.)

If anything does a readdir of /, and ends up accessing an NFS mount, it will be slower. I don't think anything actually should ever do that (acess /* when they're trying to find out something about /home/user/foo), but keeping the NFS mounts in /net is the traditional place.

Yeah, you definitely want autofs.

share|improve this answer
    
Probably bash tab-completion on /someth[ing] will stat things to see what's a directory and what's not. So yeah, always put potentially-broken mount points tucked away somewhere. –  Peter Cordes Dec 10 '09 at 19:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.