LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   autofs subdirectories (https://www.linuxquestions.org/questions/linux-newbie-8/autofs-subdirectories-4175474833/)

packets 08-27-2013 12:05 AM

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

avishorp 08-27-2013 06:41 AM

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?

packets 08-27-2013 06:54 AM

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.

avishorp 08-27-2013 07:28 AM

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.

lleb 08-27-2013 07:47 AM

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...

packets 08-27-2013 09:46 AM

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


lleb 08-30-2013 04:39 PM

Quote:

Originally Posted by packets (Post 5016906)
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.


All times are GMT -5. The time now is 07:49 PM.