You are not logged in.

#1 2013-01-10 14:00:00

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 323

Question about Autofs [Solved]

I have some nfs mounts defined, e.g /home/andrew

I can mount these to /mnt

# mount computer:/home/andrew /mnt/computer

in which case the folder /mnt/computer is my home folder on computer

$ cd /mnt/computer
$ ls
[list of contents of /home/andrew]

Of course

# showmount --exports computer
correctly returns /home/andrew

I have now installed autofs and added

/mnt -hosts --timeout=60

Everything works fine, but not as expected.

If I cd to /mnt/computer I now find that it has mounted /home/andrew to /mnt/computer thus

$ cd /mnt/computer
$ ls
home
$ cd home
ls andrew
$ cd andrew
$ pwd
/mnt/computer/home/andrew

Is it possible to make autofs mount the filesystem in the same way as nfs does?

Andrew

Last edited by fdservices (2013-01-15 12:05:20)

Offline

#2 2013-01-14 23:26:40

forshark
Member
Registered: 2013-01-03
Posts: 34

Re: Question about Autofs [Solved]

Yes you can...

EX:
[/etc/autofs/auto.master

/mnt    /etc/autofs/auto.nfs]

[/etc/autofs/auto.nfs

computer    -timeout=60     host:/path/to/export]

Hope this help.

Offline

#3 2013-01-14 23:30:21

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Question about Autofs [Solved]

You know that systemd has an autofs feature built in?

Offline

#4 2013-01-15 12:05:01

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 323

Re: Question about Autofs [Solved]

Thanks - that worked after I made sure that auto.nfs was properly terminated with a cr/lf

I will look at the systemd (automount?) feature. Thanks for the tip.


Andrew

Offline

#5 2013-01-16 01:31:06

forshark
Member
Registered: 2013-01-03
Posts: 34

Re: Question about Autofs [Solved]

And for systemd automounting "good point glorious" Everything I always wish I had baked into linux (with regards to nfs mount handling)

Here's how I did it on my machine:

step one pimp your /etc/fstab

# begin /etc/fstab

# archie needs a /home
server:/path/to/home    /home/archie    nfs    rsize=8192,wsize=8192,timeo=14,rw,soft,intr,noauto,x-systemd.automount    0 0

# end of the world

step 2:
Get rid of the bogus

systemctl disable autofs &&
pacman -Rs autofs &&
rm -r /etc/autofs &&
shutdown -r now

Thats it your free chicken is baked.

Offline

#6 2013-01-18 08:28:24

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 323

Re: Question about Autofs [Solved]

One question

Why rsize=8192,wsize=8192?

Andrew

Offline

#7 2013-01-21 10:32:39

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 323

Re: Question about Autofs [Solved]

OK, that was pretty much a disaster. Set up automount on systemd and it tried to mount shares which were not running at start up in spite of the noauto flag being set. Had to boot into a terminal and reset the fstab before I could start up cleanly.

I have moved back to autofs for the moment, but that also does not appear foolproof. I knwo this is sacrilege, but Windows handles remote mounts much better than Linux.

Andrew

Offline

Board footer

Powered by FluxBB