Ubuntu 10.10で、NFS共有フォルダをautofsで自動マウントする方法
読了まで:約2分
概要: Ubuntu 10.10 で
0. 準備
サーバ側
NFS 共有フォルダを
クライアント側
まず、
Ubuntu 10.10 では
$ sudo apt-get install nfs-common
して
次にautofs
をautofs
$ sudo apt-get install autofs
1. autofs の設定
まず、
僕の/etc/auto.qnap
で、/etc/auto.qnap
に
share -fstype=nfs 192.168.11.13:/share/share
backup -fstype=nfs 192.168.11.13:/share/backup
windows -fstype=nfs 192.168.11.13:/share/windows
USBDisk1 -fstype=nfs 192.168.11.13:/share/USBDisk1
この-fstype=nfs
は192.168.11.13:/share/share
で、autofs
の/etc/auto.master
を
親設定ファイルは
code:_
Sample auto.master file
This is an automounter map and it has the following format
key [[ -mount-options-separated-by-comma ]] location
For details of the format look at autofs(5).
#/misc /etc/auto.misc
NOTE: mounts done from a hosts map will be mounted with the
"nosuid" and "nodev" options unless the "suid" and "dev"
options are explicitly given.
#/net -hosts
Include central master map if it can be found using
nsswitch sources.
Note that if there are entries for /net or /misc (as
above) in the included master map any keys that are the
same will not be seen as the first read key seen takes
precedence.
+auto.master
と+auto.master
の
# +auto.master
と
それで/etc/auto.qnap
を/etc/auto.master
を
僕の
/media/QNAP /etc/auto.qnap
ちなみに、
/media/QNAP/
share/ -> 192.168.11.13:/share/share/
backup/ -> 192.168.11.13:/share/backup/
windows/ -> 192.168.11.13:/share/windows/
USBDisk1/ -> 192.168.11.13:/share/USBDisk1/
と
で、
$ sudo service autofs restart
して、autofs
を/var/log/syslog
等に
2. マウントポイントとなるディレクトリの作成
以上でautofs
の
それで
$ sudo mkdir -p /media/QNAP/share
$ sudo mkdir -p /media/QNAP/backup
$ sudo mkdir -p /media/QNAP/windows
$ sudo mkdir -p /media/QNAP/USBDisk1
と
で、
4. 以上
とautofs
を
ああこの
あと、
つーわけで、autofs
#FIXME