赞
踩
IP地址:192.168.2.93
IP地址:192.168.2.250
共享账号:ad
共享密码:sharepasswd
共享成功之后,可以通过\\192.168.2.93的方式连接到共享文件夹。
注意:挂载点是必须先存在的。
[root@dscq-250 ~]# pwd
/root
[root@dscq-250 ~]# mkdir /root/test
[root@dscq-250 ~]# ll
总用量 4
-rw-------. 1 root root 1000 8月 4 10:50 anaconda-ks.cfg
drwxr-xr-x. 2 root root 6 9月 9 15:05 test
[root@dscq-250 test]# pwd
/root/test
[root@dscq-250 test]# touch from_linux_before_mount.log
[root@dscq-250 test]# ll
总用量 0
-rw-r--r--. 1 root root 0 9月 9 15:08 from_linux_before_mount.log
[root@dscq-250 test]# cd ../ #挂载时一定不要在挂载点当前目录,否则容易挂载失败 [root@dscq-250 ~]# mount //192.168.2.93/share /root/test -o username=ad,,password=sharepasswd [root@dscq-250 ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/centos-root 50G 6.7G 44G 14% / devtmpfs 3.8G 0 3.8G 0% /dev tmpfs 3.8G 0 3.8G 0% /dev/shm tmpfs 3.8G 89M 3.8G 3% /run tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup /dev/mapper/centos-home 146G 680M 146G 1% /home /dev/xvda1 497M 125M 373M 26% /boot tmpfs 730M 0 730M 0% /run/user/0 //192.168.2.93/share 430G 40G 390G 10% /root/test ##看到这一行表示挂载成功## [root@dscq-250 ~]# cd /root/test/ [root@dscq-250 test]# ll 总用量 0 drwxr-xr-x. 2 root root 0 9月 9 11:41 12233 -rwxr-xr-x. 1 root root 0 9月 9 11:42 from windows before mount.txt -rwxr-xr-x. 1 root root 0 9月 9 11:42 欢迎来到共享文件夹.txt
注意:
[root@dscq-250 test]# pwd
/root/test
[root@dscq-250 test]# ll
总用量 0
drwxr-xr-x. 2 root root 0 9月 9 11:41 12233
-rwxr-xr-x. 1 root root 0 9月 9 11:42 from windows before mount.txt
-rwxr-xr-x. 1 root root 0 9月 9 11:42 欢迎来到共享文件夹.txt
[root@dscq-250 test]# touch from_linux_after_mount.log
[root@dscq-250 test]# ll
总用量 0
drwxr-xr-x. 2 root root 0 9月 9 11:41 12233
-rwxr-xr-x. 1 root root 0 9月 9 15:40 from_linux_after_mount.log #####
-rwxr-xr-x. 1 root root 0 9月 9 11:42 from windows before mount.txt
-rwxr-xr-x. 1 root root 0 9月 9 11:42 欢迎来到共享文件夹.txt
注意:挂载成功之后,若在linux挂载点创建新文件(夹)是可以在windows共享文件夹中查看到的;
[root@dscq-250 test]# ll
总用量 0
drwxr-xr-x. 2 root root 0 9月 9 11:41 12233
-rwxr-xr-x. 1 root root 0 9月 9 15:40 from_linux_after_mount.log
drwxr-xr-x. 2 root root 0 9月 9 15:42 from windows after mount #######
-rwxr-xr-x. 1 root root 0 9月 9 11:42 from windows before mount.txt
-rwxr-xr-x. 1 root root 0 9月 9 11:42 欢迎来到共享文件夹.txt
注意:挂载成功之后,若在windows共享文件夹创建新文件(夹)还是可以在linux挂载点文件夹中查看到的;
[root@dscq-250 test]# ll
总用量 0
drwxr-xr-x. 2 root root 0 9月 9 11:41 12233
-rwxr-xr-x. 1 root root 0 9月 9 15:40 from_linux_after_mount.log
drwxr-xr-x. 2 root root 0 9月 9 15:42 from windows after mount
-rwxr-xr-x. 1 root root 0 9月 9 11:42 from windows before mount.txt
-rwxr-xr-x. 1 root root 0 9月 9 11:42 欢迎来到共享文件夹.txt
您在 /var/spool/mail/root 中有新邮件
[root@dscq-250 test]# rm -rf 12233
[root@dscq-250 test]# ll
总用量 0
-rwxr-xr-x. 1 root root 0 9月 9 15:40 from_linux_after_mount.log
drwxr-xr-x. 2 root root 0 9月 9 15:42 from windows after mount
-rwxr-xr-x. 1 root root 0 9月 9 11:42 from windows before mount.txt
-rwxr-xr-x. 1 root root 0 9月 9 11:42 欢迎来到共享文件夹.txt
注意:挂载成功之后,若在linux挂载点删除新文件(夹)是可以在windows共享文件夹中看到变化的;
操作删除文件夹from windows after mount
[root@dscq-250 test]# pwd
/root/test
[root@dscq-250 test]# ll
总用量 0
-rwxr-xr-x. 1 root root 0 9月 9 15:40 from_linux_after_mount.log
-rwxr-xr-x. 1 root root 0 9月 9 11:42 from windows before mount.txt
-rwxr-xr-x. 1 root root 0 9月 9 11:42 欢迎来到共享文件夹.txt
注意:挂载成功之后,若在windows共享文件夹删除新文件(夹)是可以在linux挂载点文件夹中看到变化的;
[root@dscq-250 test]# umount /root/test umount: /root/test:目标忙。 (有些情况下通过 lsof(8) 或 fuser(1) 可以 找到有关使用该设备的进程的有用信息) [root@dscq-250 test]# cd ../ [root@dscq-250 ~]# umount /root/test [root@dscq-250 ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/centos-root 50G 6.7G 44G 14% / devtmpfs 3.8G 0 3.8G 0% /dev tmpfs 3.8G 0 3.8G 0% /dev/shm tmpfs 3.8G 89M 3.8G 3% /run tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup /dev/mapper/centos-home 146G 680M 146G 1% /home /dev/xvda1 497M 125M 373M 26% /boot tmpfs 730M 0 730M 0% /run/user/0 [root@dscq-250 ~]# cd /root/test/ [root@dscq-250 test]# ll 总用量 0 -rw-r--r--. 1 root root 0 9月 9 15:34 from_linux_before_mount.log
注意:取消挂载之后,原来在/root/test文件夹中的文件(夹)又可以看到了;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。