LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2013, 01:05 AM   #1
packets
Member
 
Registered: Oct 2005
Posts: 310

Rep: Reputation: 30
autofs subdirectories


I have configured autofs in my box and it is working. cd to /data/files is successful.

Code:
[root@karagor etc]# cat auto_master | grep data
/data auto_data -

[root@karagor etc]# cat auto_data
files       -       booger:/vol/data
+auto_data
However, I need also /data/files/secretary/folders to be on autofs. I thought configured auto_data like this will resolve the issue but it did not

Code:
[root@karagor etc]# cat auto_data
files       -       booger:/vol/data
files/secretary/folders       -       cereal:/vol/data/secretary/folders 
+auto_data
Manually mounting has no issue so it just boils down on the autofs.

Has anyone already experience this kind of setup? Is this possible to configure? Any advise?

BR,

Packets

Last edited by packets; 08-27-2013 at 07:52 AM.
 
Old 08-27-2013, 07:41 AM   #2
avishorp
LQ Newbie
 
Registered: Apr 2010
Posts: 6

Rep: Reputation: 0
If you're mounting /vol/data of "files" you will get everything within /vol/data including secretary/folders, so why do you need the second automount at all?
 
Old 08-27-2013, 07:54 AM   #3
packets
Member
 
Registered: Oct 2005
Posts: 310

Original Poster
Rep: Reputation: 30
Quote:
If you're mounting /vol/data of "files" you will get everything within /vol/data including secretary/folders, so why do you need the second automount at all?
It is on a different NFS Share (forgot to update my post). Anyway, I was able to fix it with the below.

Code:
[root@karagor etc]# cat auto_master | grep data
/data/files/secretary auto_data2 -
/data auto_data -

[root@karagor etc]# cat auto_data2
folders - cereal:/vol/data/secretary/folders
If you guys have other suggestions, just let me know.
 
Old 08-27-2013, 08:28 AM   #4
avishorp
LQ Newbie
 
Registered: Apr 2010
Posts: 6

Rep: Reputation: 0
I think it's problematic because when autofs starts, it will try to create an empty directory /data/files/secretary, thereby triggering the mount of /data, leaving it always mounted.

The only solution I see to your problem is (auto)mounting each subdirectory of /data separately

Avishay.
 
Old 08-27-2013, 08:47 AM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
as you have multiple NFS shares, each share should have its own autofs entry and its own mount point. do not mount a share within a share.

NFS share_1 gets mount_point_1
NFS share_2 gets mount_point_2
etc...
 
Old 08-27-2013, 10:46 AM   #6
packets
Member
 
Registered: Oct 2005
Posts: 310

Original Poster
Rep: Reputation: 30
Quote:
as you have multiple NFS shares, each share should have its own autofs entry and its own mount point. do not mount a share within a share.
It has now its own entry on autofs. However, I'm not sure regarding the share within a share. I believe you are referring on the settings below. Would there be an issue in my settings?

Code:
[root@karagor etc]# cat auto_data
files       -       booger:/vol/data
files/secretary/folders       -       cereal:/vol/data/secretary/folders 
+auto_data
 
Old 08-30-2013, 05:39 PM   #7
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Quote:
Originally Posted by packets View Post
It has now its own entry on autofs. However, I'm not sure regarding the share within a share. I believe you are referring on the settings below. Would there be an issue in my settings?

Code:
[root@karagor etc]# cat auto_data
files       -       booger:/vol/data
files/secretary/folders       -       cereal:/vol/data/secretary/folders 
+auto_data
you have the share inside of a share:

Code:
files       -       booger:/vol/data
files/secretary/folders       -       cereal:/vol/data/secretary/folders
files is the share, then again you have files/secretary/folders there is no need to do that unless they are physically different NFS servers, if that is the case then you still dont want to mount both booger and cereal (your 2 servers) into the same mount point.

you have server booger mounting in ~/files

then you have server cereal also mounting inside ~/files

this is unwise and can cause issues.

a better idea might be to have them mount to different locations, then maybe symlink them to a single location, but even that im not 100% sure is a good idea.

with autofs, the directory ~/files is EMPTY until you access it. Once you access that directory then what ever is shared via booger is going to appear in that directory and to the user look no different and act no different then if it were a local file/directory they would access any normal way.

that means files/secretary/folders will never be seen by any user with autofs as /secretary/folders are not on server booger, but on server cereal.

the /etc/exports from booger will not have that path unless you created it and then you are just creating shares within shares. its a nasty loop to put yourself in.
 
  


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
[SOLVED] Listing only subdirectories. stf92 Slackware 8 08-14-2010 11:55 PM
Makefiles and subdirectories Jerry Mcguire Programming 11 03-16-2010 09:07 PM
about subdirectories nesta Programming 4 02-08-2007 07:18 PM
Makefile and subdirectories pycoucou Programming 4 08-18-2005 05:43 AM
email and subdirectories hiertjou123 Linux - Newbie 5 07-16-2003 02:08 PM


All times are GMT -5. The time now is 06:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration