NFS 是用於 Linux 與 Linux 系統網路連線的工具,功能類似 Windows 下的網路芳鄰。一般 Linux 與 Windows 連線必須使用 Samba ,然而 Linux 與 Linux 則是使用 NFS 較簡單快速。
1.架設NFS Server
在 debian 下要架設 NFS 伺服器必需安裝以下套件
apt-get install nfs-common nfs-kernel-server portmap
接著修改 /etc/exports 以設定要分享的目錄
$ sudo vim /etc/exports
#[欲分享的目錄][主機名稱1或IP1(參數1,參數2)]
[主機名稱2或IP2(參數3,參數4)]
/tmp *(rw,sync)
/home/public 192.168.0.*(rw,sync)*(ro,sync)
/home/public 192.168.0.0/24(rw,sync)*(ro,sync)
$ sudo /usr/sbin/exportfs
$ sudo /etc/init.d/nfs-kernel-server restart
2.NFS Client
首先在 Client 下建立目錄,例如你要把Server端分享的目錄掛載在 /mnt/nfs/share ,則要先建立此目錄︰
$ sudo mkdir -p /mnt/nfs/share
$ sudo mount -t nfs hostname(orIP):/directory /mnt/nfs/share
- ps. 此處的 directory 是伺服端分享資料夾在系統中的絕對路徑,例如若是分享 /var/lib/www 這個目錄,則應該使用以下語法︰
$ sudo mount -t nfs IP_ADDRESS:/var/lib/www /mnt/nfs/share
如果要讓 NFS 在開機時自動掛載,必須在 /etc/fstab 中加入一行
hostname(orIP):/directory /mnt/nfs/share nfs rsize=8192,wsize=8192,timeo=14,intr
autofs 可以在需要使用時再自動掛載,請先安裝 autofs 套件︰
$ sudo apt-get install autofs
/mnt/nfs /etc/auto.nfs --timeout 60
share -rw,soft,intr,rsize=8192,wsize=8192 hostname:/directory
參考資料︰
鳥哥私房菜 http://linux.vbird.org/linux_server/0330nfs.php
摩托學園 http://moto.debian.org.tw/viewtopic.php?t=3419
Red Hat Linux 用戶自訂手冊 http://www.php5.idv.tw/documents/redhat ... mount.html
1 comment:
Provide your e-mail and verification documents to register with a protected online on line casino. The sport additionally allows for broad range|a variety} of bets, so that you can|so as to|to have the ability to} discover the proper odds for you. 메리트카지노 You can go for an even-money bet on red, black, odd, and even. You may go lengthy and bet on a single number, or bet on a "avenue" on three completely different numbers, for instance. You must bet on which deck will contain an identical card, wagering on either Andar or Bahar. The vendor then draws alternately from the two decks till an identical card comes up.
Post a Comment