/etc/auto_home を編集する。
# vi /etc/auto_home
hoge localhost:/export/home/hoge
oracle localhost:/export/home/oracle
ユーザのホームディレクトリを変更する。ユーザのホームディレクトリでない場合はこの手順は不要。
perl -i.org -ple 's/\/export\/home\//\/home\//' passwd
autofs を再起動する。
# svcadm restart svc:/system/filesystem/autofs:default
確認してみる。
# ls /home
(し〜ん)
あれ?マウントされてない? /home/oracle に移動してみる。
# cd /home/oracle
あれ?移動できた。確認してみる。
# ls /home
oracle
でた。
/home/hoge に移動してみる。
# cd /home/hoge # ls /home hoge oracle
hoge もでた。
しばらくほっておくとアンマウントされてる。
# ls /home
(し〜ん)
オートマウントは、そのディレクトリに5分間アクセスがなければ自動的にアンマウントします。
http://www.b-dash.net/solaris/solaris_5.html
ということらしい。