[daily] 主机间目录共享

1. 安装nfs工具,其实是mount需要mount.fs

否则会出现类似如下错误:

[root@stds ~]# mount -t nfs 192.168.7.1:/home/tong/Src /root/src
mount: wrong fs type, bad option, bad superblock on 192.168.7.1:/home/tong/Src,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program) In some cases useful info is found in syslog - try
dmesg | tail or so.

安装:

[root@stds ~]# yum install nfs-utils

2. 挂载:

[root@stds ~]# mount -t nfs 192.168.7.1:/home/tong/Src /root/src
[root@stds ~]# ls
anaconda-ks.cfg src
[root@stds ~]# ll src/
total
drwxr-xr-x. Nov : BUILD
drwxr-xr-x. Dec : copyleft
drwxr-xr-x. Mar copyright
drwxr-xr-x. Oct : INSTALL
drwxr-xr-x. Dec : thirdparty

3. 开机自动挂载:

在 /etc/fstab 中,添加如下行

[root@stds ~]# tail -n1 /etc/fstab
192.168.7.1:/home/tong/Src /root/src nfs defaults,nofail,actimeo=

[daily][qemu][kvm] 使用virtfs在host与guest之间共享目录

05-07 15:00