Я не могу понять автофо

381
user341021

У меня есть сервер NFS, на котором я экспортирую следующее:

/exports/netapps *.*.*.*/16(ro,async,root_squash,no_subtree_check) 

В этой папке есть несколько подпапок, которые должны быть видны на клиентах.

Я хочу использовать autofs для монтирования на клиентах по следующему пути:

/opt/netapps/ 

Это я могу сделать, но когда я это делаю, папка / opt становится непригодной для использования, потому что с ней что-то делает автомонтировщик. Я не могу создать новую подпапку для / opt или сделать что-нибудь на самом деле ... Я получаю «Отказано в доступе» для всего ... как root!

Мои файлы:

cat /etc/auto.master.d/opt.autofs  /opt file:/etc/auto.opt --timeout 10  cat /etc/auto.opt  netapps -fstype=nfs4 lwp16.service.rug.nl:/netapps 

Что я сделал не так? Как мне это решить? У кого-нибудь есть идея, пожалуйста?

1

2 ответа на вопрос

0
Lars Rohrbach

Your current opt.autofs file basically tells autofs to take control of the /opt directory, so that it can build arbitrary mountpoints there for automounting. I would recommend that you instead create and use a directory where you can allow autofs to be in full control -- something like /opt/auto (so you would end up using /opt/auto/netapps), or perhaps /remote (so you would end up using /remote/netapps).

For the former choice, you could simply change your /opt.autofs file:

/opt/auto file:/etc/auto.opt --timeout 10 
0
Sathish

The problem is with your map file (auto.opt) having incorrect export location (/exports/netapps)

nfs server:

cat /etc/exports /exports/netapps *.*.*.*/16(ro,async,root_squash,no_subtree_check) 

nfs client

cat /etc/auto.master ....omitted lines..... /misc /etc/auto.misc /opt /etc/auto.opt --timeout 10 ....omitted lines..... cat /etc/auto.opt netapps -ro,nfsvers=3 lwp16.service.rug.nl:/exports/netapps service nfs restart service autofs stop service autofs start 

Also you may experience name resolution issues due to dns may cause this issue. In that case try ip address in your map file (ip-addr-nfs-server:/exports/netapps).

By default, nfs is mounted with version4 if none specified as mount options.

Похожие вопросы