从linux内核2.4.0以后mount支持mount --bind 一个目录到另外一个目录

比如:

[root@localhost wind]# mkdir test1 test2 dir3

mount --bind test1 test2

把test1挂载到test2,如果test2目录有内容将被遮住(dir2目录的内容一样存在。就好像窗帘把窗户遮住一样。窗户始终存在,只是被遮住而已,等umount了,原来dir2目录的内容就显示出来了)

要取消挂载使用umount即可

并不是使用mount --move dir1 dir2

mount --move是把dir1移到dir2,如果使用mount --move dir1 dir2将报错

mount: wrong fs type, bad option, bad superblock on dir1,

missing codepage or other error

In some cases useful info is found in syslog - try

dmesg | tail  or so

使用mount --move dir1 dir3就把dir1挂载到dir3(先umount dir1+再mount dir1到dir3),同时dir2的内容显示出来,dir3的原来内容被dir1的遮住

如果在开机的时候自动挂载,可以在/etc/fstab里面增加以下内容

dir1   dir2    none    bind   0   0

mount经常使用方法如下:

1.mount iso

mount -o loop a.iso /mnt/iso

2.挂载fat32到linux下

mount -t vat /dev/sda1 /mnt/xp

3.挂载之后,访问里面乱码的解决

mount –o iocharset=gb2312 codepage=936 /dev/hda5 /mnt/hda5

4.为什么mount上去以后分区普通用户不可写?

mount时加上 –o umask=000 即可:

# mount –o umask=000, iocharset=cp936 /dev/hda5 /mnt/hda5
5.如何挂载samba 分区?

# mkdir /mnt/share

# mount -t smbfs -o username=root,password=abc,codepage=936,iocharset=gb2312 //IP/share /mnt/share

最新文章

  1. 在CentOS 7 中 安装 VSFTP
  2. GADL配置编译
  3. Java中List,ArrayList、Vector,map,HashTable,HashMap区别用法
  4. $.each 和$(selector).each()的区别
  5. myeclipse 常用快捷键总结
  6. emulator: ERROR: Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration.
  7. C++设计模式——单例模式
  8. 使用RecyclerView实现瀑布流的效果
  9. SYS_CONTEXT 详细用法
  10. Python之禅及其翻译
  11. pyhton 监听文件输入实例
  12. 关于idea在运行web项目时部署的位置
  13. 将Windows系统移到另一个硬盘
  14. Mysql基础之 事务
  15. 为python 添加新功能-dump
  16. shell case语句
  17. Final阶段第1周/共1周 Scrum立会报告+燃尽图 01
  18. jquery mobile各类组件刷新方法
  19. FTL页面常用到的一些方法combobox、combotree、datagrid
  20. Change R source code

热门文章

  1. 终于明白为什么要加 final 关键字了!
  2. python发送钉钉机器人脚本
  3. c# async,await, 委托函数
  4. NIO网络访问模式实践
  5. Learning to Track Any Object
  6. buddo源码分析-transport组件之Netty(一)
  7. JDBC操作数据库工具类(使用阿里Druid原生API创建数据源)
  8. Java的面向对象的原则
  9. 内存自动清理.sql
  10. 【451】python 同一行打印进度条