频道栏目
首页 > 资讯 > Linux > 正文

linux系统下局域网内挂载其他操作系统目录的方法

18-07-12        来源:[db:作者]  
收藏   我要投稿

1.Linux使用mount挂载Windows共享文件夹

mount -t cifs -o username=allen,password=smart //192.168.212.45/gealei_Share /usr/local/suninfo/restore/

2.Linux使用mount挂载linux系统文件夹

目标机器上开启服务如下

rpm -qa | grep nfs-utils
rpm -qa | grep rpcbind
yum -y install nfs-utils
yum -y install rpcbind

安装完成之后配置nfs访问目录,配置文件位置/etc/exports,默认是空的这里添加一行:

/nfs_test 192.168.212.45(rw,no_root_squash,no_all_squash,async)

现在配置完这些配置,启动相关服务:

systemctl start rpcbind.service
systemctl start nfs.service

服务器上配置如下:

首先创建挂载点:mkdir/mnt/test1

然后挂载nfs:mount-t nfs192.168.212.46:/nfs_test /mnt/test1

如果需要设置开机挂载,在/etc/fstab添加一行配置即可:192.168.212.46:/nfs_test /mnt/test1 nfs rw,tcp,intr01然后服务端和客户端都要用enable设置nfs和rpcbind服务开机启动,然后才可以正常挂载

3. 卸载

# umount /usr/local/suninfo/restore/

umount 时提示错误target is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)),你可以先切换到别的目录再试一次, 原因也可能是其他进程可能在使用目录 , 可以先关闭使用该目录的进程 , 然后再 umount , 命令如下 (使用fuser需安装psmisc# yum install psmisc) :

# fuser -m /usr/local/suninfo/restore/
/usr/local/suninfo/restore/:  2806c

# ps aux | grep 2806
root      2806  0.0  0.5 116040  2836 pts/0    Ss   11:31   0:00 -bash
root      2925  0.0  0.1 112648   960 pts/0    S+   14:36   0:00 grep --color=auto 2806

# kill -9 2806

# umount /usr/local/suninfo/restore/
相关TAG标签
上一篇:repost: du-查看文件夹大小-并按大小进行排序操作实例
下一篇:SHA-256算法改进策略及实现教程
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站