国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
ubuntu10.4 開啟 NFS

ubuntu10.4 開啟 NFS(轉(zhuǎn))

1 setup nfs server:
 "sudo apt-get install nfs-kernel-server"
2 edit the configure file
 "sudo gedit /etc/exports"
 add this line to file:  "/nfs *(sync,rw,no_root_squash)"
 
 /nfs point to the directory which you want clinet to mount.
 * means everyone can access to this nfs, you can replace it with ip marks,like:192.168.1.*
 (sync,rw,no_root_squash) is the parameters used for nfs
3 restart the nfs server
 "sudo  /etc/init.d/nfs-kernel-server restart" 
 notice that we should use sudo before every command, or an error would be caused.
4  test your nfs
 creat a folder to mount the nfs server folder
  "mkdir testNFS"
 then use following command to mount the nfs server folder :
  "sudo mount 192.168.1.101:/nfs  testNFS/"
 this means we will mount  the server's folder "/nfs" to client folder "testNFS/",
 server's is 192.168.1.101
5 umount the folder
   use this command to unmount the server's folder
  "sudo umount /testNFS"
 
 6 close nfs server
if don't need to run the nfs server,we can close it by this command:
 "sudo  /etc/init.d/nfs-kernel-server stop" 

舊版本的安裝過程,部分可借鑒

涉及文件
portmap hosts.deny  hosts.allow

涉及操作(按順序如下)
sudo /etc/init.d/portmap  restart
sudo /etc/init.d/nfs-common restart
sudo /etc/init.d/nfs-kernel-server restart

安裝 server 和 client


Ubuntu上默認(rèn)是沒有安裝 NFS服務(wù)器的,首先要安裝NFS服務(wù)程序:
$ sudo apt-get install nfs-kernel-server
(安裝nfs-kernel-server時(shí),apt會自動(dòng)安裝nfs-common和portmap)
這樣,宿主機(jī)就相當(dāng)于NFS Server。

同樣地,目標(biāo)系統(tǒng)作為NFS的客戶端,需要安裝NFS客戶端程序。如果是Debian/Ubuntu系統(tǒng),則需要安裝 nfs-common。
$ sudo apt-get install nfs-commmon
nfs-common和nfs-kernel-server都依賴于portmap!
這樣就安裝完了,下面進(jìn)行配置

配置 NFS

配置portmap
方法1: 編輯/etc/default/portmap, 將 最后一行注釋掉.
方法2: $ sudo dpkg-reconfigure portmap , 對Should portmap be bound to the loopback address? 選N.

配置/etc/hosts.deny
(禁止任何host(主機(jī))能和你的NFS服務(wù)器進(jìn)行NFS連接),加入:
### NFS DAEMONS
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

配 置/etc/hosts.allow
允許那些你想要的主機(jī)和你的NFS服務(wù)器建立連接。下列步驟將允許任何IP地址以192.168.197開頭的主機(jī)(連接到NFS服務(wù)器上),也可以指定特定的IP地址。參看man頁 hosts_access(5), hosts_options(5)。加入:
### NFS DAEMONS
portmap: 192.168.197.
lockd: 192.168.197.
rquotad: 192.168.197.
mountd: 192.168.197.
statd: 192.168.197.

/etc/hosts.deny 和 /etc/hosts.allow 設(shè)置對portmap的訪問. 采用這兩個(gè)配置文件有點(diǎn)類似"mask"的意思. 現(xiàn)在/etc/hosts.deny中禁止所有用戶對portmap的訪問. 再在/etc/hosts.allow 中允許某些用戶對portmap的訪問.

配置/etc/exports
NFS掛載目錄及權(quán)限由/etc/exports文件定義  
比如我要將將我的home目錄中的/home/liliming/arm2410目錄讓192.168.197.*的IP共享, 則在該文件末尾添加下列語句:
/home/liliming/arm2410     192.168.197.*(rw,sync,no_root_squash)
或者: /home/liliming/arm2410     192.168.197.0/24(rw,sync,no_root_squash)
注意這里,這樣寫有可能你的NFS還不能用,你可以允許所以IP共享你的目錄,語句如下:
/home/liliming/arm2410    *(rw,sync,no_root_squash)

至此配置完成,下面啟動(dòng)NFS

啟動(dòng)NFS

sudo  /etc/init.d/portmap  restart
sudo  /etc/init.d/nfs-common restart
sudo  /etc/init.d/nfs-kernel-server restart

測試 NFS

Ubuntu 下
sudo mount  localhost:/home/liliming/arm2410  /mnt
ls /mnt
看是否已經(jīng)掛載成功
開發(fā)板 下
mount  192.168.197.75:/home/liliming/arm2410  /mnt
ls /mnt
看是否已經(jīng)掛載成功(192.168.197.75 是Ubuntu的IP 地址)

可能出現(xiàn)的錯(cuò)誤:
1. 掛載不成功,具體提示信息不記得了,可以這樣試試
配置/etc/exports
/home/liliming/arm2410     *(rw,sync,no_root_squash)
也就是允許所有的IP 訪問
2. 提示 mount rpc unable to receive errno connection refused
說明你的服務(wù)器端(Ubuntu )服務(wù)沒設(shè)定好,原因可能如下:
a. NFS 沒啟動(dòng),按照上面的啟動(dòng)步驟 再重新啟動(dòng)一下
b. 看一下 文件 /etc/exports 和文件  /etc/hosts.allow 里面的IP 是不是 包含 你的開發(fā)板 IP,
不包含的話,把你的網(wǎng)段寫上,重新啟動(dòng) NFS







NFS安裝

nfs原理是通過網(wǎng)絡(luò),將遠(yuǎn)程主機(jī)共享的文件系統(tǒng),掛載到本機(jī)。Ubuntu10.04上默認(rèn)是沒有安裝NFS服務(wù)器的,首先要安裝NFS服務(wù)程序:

sudo apt-get install nfs-kernel-server

 (安裝nfs-kernel-server時(shí),apt會自動(dòng)安裝nfs-common和 portmap) 這樣,宿主機(jī)就相當(dāng)于NFS Server。


也可以通過軟件管理包來安裝nfs-kernel-server


  宿主機(jī)NFS的配置

2.1  修改配置文件/etc/exports

在終端下用#  sudo gedit  /etc/exports打開exports文件。

如果你沒有配置過這個(gè)文件的話此文件應(yīng)該是空的。在開始部分寫入

/hhm   *(rw,sync,no_root_squash)

/hhm  -- 是要與目標(biāo)板共享的目錄;

       -- 表示允許任意用戶使用,也可以使用具體IP;
(rw,sync,no_root_squash) 

-- rw,掛載此目錄的客戶機(jī)對此目錄有讀寫權(quán)利;
sync,……;
no_root_squash,掛載此目錄的客戶機(jī)享有主機(jī)root的權(quán)利;

我是將主機(jī)的根目錄設(shè)置為共享目錄  *(rw,sync,no_root_squash)

OK,保存,退出。

修改完成之后輸入:#  exportfs –rv來使配置文件生效

2.2   配置宿主機(jī)的IP

配置宿主機(jī)的IP,在命令行中輸入 # ifconfig   來查看本機(jī)的IP地址。如果沒有設(shè)置,可以用命令 # ifconfig eth0 192.168.0.18 來設(shè)置IP。其中的IP地址可以根據(jù)具體情況來設(shè)定。設(shè)定完成后在通過ifconfig來再次查看是否已經(jīng)設(shè)定成功。

2.3   啟動(dòng)宿主機(jī)NFS服務(wù)

安裝完NFS服務(wù)后就可以通過 #  /etc/init.d/nfs-kernel-server restart(/etc/init.d/nfs-kernel-server start)來重新開啟網(wǎng)絡(luò)文件系統(tǒng)服務(wù),以便后面的開發(fā)板掛載。也可以通過#  /etc/init.d/nfs-kernel-server stop來停止。

  目標(biāo)板的掛載操作

給你的目標(biāo)機(jī)上電,目標(biāo)板上的Linux操作系統(tǒng)起來以后,在PC機(jī)上Ubuntu操作系統(tǒng)上打開minicom,通過串口向目標(biāo)板發(fā)送shell命令。

像主機(jī)操作一樣,首先檢查目標(biāo)板(客戶機(jī))的IP是否與宿主機(jī)的IP再同一個(gè)地址段上,否則用上面用過的命令進(jìn)行檢查和設(shè)置本地IP。

設(shè)置完IP之后可以ping一下檢查網(wǎng)卡、網(wǎng)線是否連接正確。

既在minicom中輸入# ping 192.168.0.18  (主機(jī)IP地址)連接成功會不斷的打印信息。

接下來就是在開發(fā)板上進(jìn)行掛載mount

 # mount -t nfs -o nolock 192.168.0.18:/  /mnt  

其中:后是客戶機(jī)掛載的共享目錄; /mnt是開發(fā)板的掛載目錄

OK,掛在完成。

通過

# cd  /mnt

# ls

可以發(fā)現(xiàn)主機(jī)的根目錄被掛載進(jìn)了開發(fā)板mnt目錄中。

如果你想取消掛在可以使用命令# umount  /mnt就可以了。

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
mini2440 nfs 掛載到ubuntu
Ethernet相關(guān)
NFS 服務(wù)器安裝配置: 安裝
ARM開發(fā)板與PC機(jī)ubuntu系統(tǒng)nfs掛載
Linux NFS 配置
Ubuntu 11.04 NFS 配置
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服