Skip to contentSkip to conversation

fairly complex nested filesystems question

DISCUSSION chris barry 2 participants 3 messages Dec 20, 2007 – Dec 21, 2007 2 messages not in the archive Kernel automounter

lore
Share & tools
lore
#0 lore raw

Greetings,

I'm trying to create a nested filesystem structure that combines an automounted nfs home directory, with bind mounts from the local machine.

The structure will look like this:
/
|-home

   `-user1        <-(nfs somehost:/home/user1)
       |-myftp    <-(bind /var/ftp/users/user1)
       `-pub_ftp  <-(bind /var/ftp/pub)

The entire structure needs to get automounted as a group on login, and then is chrooted as users ftp into this box.

My auto.master looks like this:
/home /etc/auto.home --timeout=30

My auto.home looks like this:

*              -fstype=nfs,rw,intr   10.20.30.40:/home/& \
/home/&/myftp  -fstype=file          :/var/ftp/users/& \
/home/&/ftp    -fstype=file          :/var/ftp/pub

My home mounts fine via nfs, and is chrooted (when I ftp in), but the other mounts do not occur, and no errors are thrown. Thinking it was a timing issue, and the chroot had occurred before the local mounts happened, I came in via ssh (which is not chrooted, but will not be available to users later), and I get the same results. Finding any examples of this kind of map has been challenging to say the least.

I'm assuming my map syntax is incorrect, or is this type of thing simply impossible?

Unfortunately, I have to stay at these versions.
RHEL4U5 2.6.9-55.ELsmp
ProFTPD Version 1.3.1
Linux automount version 4.1.3-199.3

What am I doing wrong here?

Thanks,
-C

maintainer
#1 lore raw
Quoted 15 lines · chris barry

Greetings,

I'm trying to create a nested filesystem structure that combines an automounted nfs home directory, with bind mounts from the local machine.

The structure will look like this:
/
|-home

   `-user1        <-(nfs somehost:/home/user1)
       |-myftp    <-(bind /var/ftp/users/user1)
       `-pub_ftp  <-(bind /var/ftp/pub)

The entire structure needs to get automounted as a group on login, and then is chrooted as users ftp into this box.

Quoted 7 lines

My auto.master looks like this:
/home /etc/auto.home --timeout=30

My auto.home looks like this:

*              -fstype=nfs,rw,intr   10.20.30.40:/home/& \
/home/&/myftp  -fstype=file          :/var/ftp/users/& \
/home/&/ftp    -fstype=file          :/var/ftp/pub

This is not valid for a couple of reasons.
First the * will match every key and so nothing else will be seen. The second and third entries aren't valid map entries for an indirect map either. Even if they were then the & can't be used on the left hand side of a map entry. This is because the & is replaced by the key that has been matched and so can't be used within the key itself. The -fstype should refer to a valid filesystem but I don't think file is a valid filesystem. If you're intending this to indicate a bind mount then just leave out the -fstype=file and leave the :<path>.

Ian

#4 lore raw
In reply to a message not in the archive
Quoted 70 lines · Ian Kent
Quoted 42 lines · chris barry
Quoted 34 lines · Ian Kent
Quoted 15 lines · chris barry

Greetings,

I'm trying to create a nested filesystem structure that combines an automounted nfs home directory, with bind mounts from the local machine.

The structure will look like this:
/
|-home

   `-user1        <-(nfs somehost:/home/user1)
       |-myftp    <-(bind /var/ftp/users/user1)
       `-pub_ftp  <-(bind /var/ftp/pub)

The entire structure needs to get automounted as a group on login, and then is chrooted as users ftp into this box.

Quoted 7 lines

My auto.master looks like this:
/home /etc/auto.home --timeout=30

My auto.home looks like this:

*              -fstype=nfs,rw,intr   10.20.30.40:/home/& \
/home/&/myftp  -fstype=file          :/var/ftp/users/& \
/home/&/ftp    -fstype=file          :/var/ftp/pub

This is not valid for a couple of reasons.
First the * will match every key and so nothing else will be seen. The second and third entries aren't valid map entries for an indirect map either. Even if they were then the & can't be used on the left hand side of a map entry. This is because the & is replaced by the key that has been matched and so can't be used within the key itself. The -fstype should refer to a valid filesystem but I don't think file is a valid filesystem. If you're intending this to indicate a bind mount then just leave out the -fstype=file and leave the :<path>.

Quoted 2 lines

Ian

Ian,

Thanks so much for your response. I got that one wrong totally wrong.

Quoted 8 lines

Given the drawing and intent though, is the idea itself even possible, or is it simply not workable in any way? If it /is/ possible, any idea on how it should be done? From your explanation, I'm (taking a blind stab here) thinking something like:

*    -fstype=nfs,rw,intr   10.20.30.40:/home/& \
     ./myftp                 :/var/ftp/users/& \
     ./ftp                   :/var/ftp/pub

Hehe, that's not quite right either.
Sorry for the curt e-mail, I'm a bit loaded up at the moment.

We didn't get the autofs version you're using for this either.

That's interesting use of the wildcard key, I'm not sure whether that would work but, in theory, it just might.

So a map would need to be something like:

*	/	-fstype=nfs,rw,intr   10.20.30.40:/home/& \
	/myftp  	               :/var/ftp/users/& \
	/ftp    	               :/var/ftp/pub

The initial "/" (the root of the multi-mount) is allowed to be omitted as an accepted shortcut. The "." isn't legal the way it is specified above.

Quoted 8 lines

Strictly speaking the mount-point directories (such
as /home/<someuser>/myftp and /home/<someuser>/ftp) must already exist as autofs doesn't, and often can't (and should'nt be able to) create directories on a remote server as it's operating as root.

Ian

(putting back on the list)

Thanks Ian! I'll give that a go.

Cheers,
-C