为什么无法通过 NFS 共享/挂载浏览已挂载的 iso?

为什么无法通过 NFS 共享/挂载浏览已挂载的 iso?

请尝试一下:下载 iso 并将其放在 /data/iso 中,例如:

[root@geppetto ~]# ls -al /data/iso
total 708620
drwxr-xr-x. 2 root root      4096 Oct 17 14:40 .
drwxr-xr-x. 3 root root      4096 Oct 17 14:36 ..
-rw-r--r--. 1 root root 725614592 Jul  7 19:26 CentOS-6.3-x86_64-LiveCD.iso

然后挂载

 [root@geppetto ~]# mkdir -p /media/centos6.3-64-live
 [root@geppetto ~]# 
 [root@geppetto ~]# mount -t iso9660 /data/iso/CentOS-6.3-x86_64-LiveCD.iso /media/centos6.3-64-live

然后通过 nfs 导出它的父目录,

[root@geppetto ~]# cat /etc/exports 
/export/iso cal-26.oma.be(ro)
[root@geppetto ~]# 
[root@geppetto ~]# service nfs reload
[root@geppetto ~]# showmount -e 
Export list for geppetto.oma.be:
/export/iso cal-26.oma.be
[root@geppetto ~]# 

然后将其挂载到客户端

[root@cal-26 ~]# mount -v -t nfs puppet-me.oma.be:/export/iso /geppettoiso
mount.nfs: timeout set for Thu Oct 25 13:39:16 2012
mount.nfs: trying text-based options 'vers=4,addr=192.168.16.49,clientaddr=192.168.15.194'
[root@cal-26 ~]# 

在 NFS 服务器上可以浏览:

[root@geppetto media]# ls -al
total 10
drwxr-xr-x.  3 root root 4096 Oct 17 15:23 .
dr-xr-xr-x. 26 root root 4096 Oct 25 11:28 ..
dr-xr-xr-x.  5 root root 2048 Jul  7 19:23 centos6.3-64-live
[root@geppetto media]# 
[root@geppetto media]# ls -al /media/centos6.3-64-live/
total 30
dr-xr-xr-x. 5 root root  2048 Jul  7 19:23 .
drwxr-xr-x. 3 root root  4096 Oct 17 15:23 ..
dr-xr-xr-x. 3 root root  2048 Jul  7 19:22 EFI
-r--r--r--. 1 root root 18416 Jul  7 19:23 GPL
dr-xr-xr-x. 2 root root  2048 Jul  7 19:23 isolinux
dr-xr-xr-x. 2 root root  2048 Jul  7 19:24 LiveOS
[root@geppetto media]#

但在 nfs 客户端上,它看起来就像原始 iso 文件:

[root@cal-26 geppettoiso]# ls -al /geppettoiso/CentOS-6.3-x86_64-LiveCD.iso 
-rw-r--r--. 1 root root 725614592 Jul  7 19:26 /geppettoiso/CentOS-6.3-x86_64-LiveCD.iso
[root@cal-26 geppettoiso]# 

原始文件:

[root@geppetto media]# ls -al /data/iso/CentOS-6.3-x86_64-LiveCD.iso
-rw-r--r--. 1 root root 725614592 Jul  7 19:26 /data/iso/CentOS-6.3-x86_64-LiveCD.iso
[root@geppetto media]# 

只是为了完整性:

[root@cal-26 geppettoiso]# mount | grep -i iso
puppet-me.oma.be:/export/iso on /geppettoiso type nfs4 (rw,relatime,vers=4.0,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.15.194,local_lock=none,addr=192.168.16.49)
[root@cal-26 geppettoiso]# 


[root@geppetto media]#  mount | grep -i iso
/data/iso/CentOS-6.3-x86_64-LiveCD.iso on /media/centos6.3-64-live type iso9660 (ro,loop=/dev/loop0)
/data/iso on /export/iso type none (rw,bind)
[root@geppetto media]# 

答案1

据我所知,一旦您的 NFS 共享已安装,只需在客户机器。NFS 共享被视为本地文件系统的一部分。


来源:http://www.linuxquestions.org/questions/linux-newbie-8/browsing-an-iso-file-in-a-nfs-share-547209/

相关内容