Chinaunix首页 | 论坛 | 博客
  • 博客访问: 615886
  • 博文数量: 120
  • 博客积分: 2284
  • 博客等级: 大尉
  • 技术积分: 1330
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-25 10:49
个人简介

http://guliqun1983.blog.163.com/blog/static/501116852011730535314/

文章分类
文章存档

2013年(23)

2012年(23)

2011年(74)

分类: LINUX

2013-04-24 10:30:28

声明:本文为原创
#####请转贴时保留以下内容######
作者GTT
本文档归属http://oldtown.cublog.cn/.转载请注明出处!
请提出宝贵意见Mail:mtloveft@hotmail.com
Linux Version:2.6.33
提示本文是关于file system 实现的介绍
 
既然文件系统要mount之后才能使用,那么简单介绍下mount命令。
我先进行一下简单的mount执行,之后看看log,执行过程如下

[root@localhost ~]# mount -l
/dev/mapper/VolGroup-lv_root on /            type ext4         (rw)
proc             on /proc          type proc         (rw)
sysfs            on /sys           type sysfs         (rw)
devpts            on /dev/pts         type devpts        (rw,gid=5,mode=620)
tmpfs            on /dev/shm         type tmpfs         (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1          on /boot          type ext4         (rw)
none             on /proc/sys/fs/binfmt_misc type binfmt_misc      (rw)
sunrpc            on /var/lib/nfs/rpc_pipefs type rpc_pipefs      (rw)
gvfs-fuse-daemon       on /root/.gvfs       type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)

[root@localhost ~]# mkdir /aaa
[root@localhost ~]# mkdir /aaa/a001
[root@localhost ~]# mkdir /aaa/a002
[root@localhost ~]# mkdir /bbb
[root@localhost ~]# mkdir /bbb/b001
[root@localhost ~]# mkdir /bbb/b002
[root@localhost ~]# ll /bbb/
total 8
drwxr-xr-x. 2 root root 4096 2010-08-23 23:18 b001
drwxr-xr-x. 2 root root 4096 2010-08-23 23:18 b002

[root@localhost ~]# mount -t ramfs 0 /bbb/b001
[root@localhost ~]# ll /bbb/
total 4
drwxr-xr-x. 2 root root    0 2010-08-23 23:20 b001
drwxr-xr-x. 2 root root 4096 2010-08-23 23:18 b002

[root@localhost ~]# mount -t ramfs 0 /bbb/b002
[root@localhost ~]# ll /bbb/
total 0
drwxr-xr-x. 2 root root 0 2010-08-23 23:20 b001
drwxr-xr-x. 2 root root 0 2010-08-23 23:20 b002
[root@localhost ~]# mount -l
/dev/mapper/VolGroup-lv_root on /               type ext4         (rw)
proc                on /proc             type proc         (rw)
sysfs               on /sys              type sysfs         (rw)
devpts               on /dev/pts           type devpts        (rw,gid=5,mode=620)
tmpfs               on /dev/shm           type tmpfs         (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1             on /boot            type ext4         (rw)
none                on /proc/sys/fs/binfmt_misc type binfmt_misc      (rw)
sunrpc               on /var/lib/nfs/rpc_pipefs type rpc_pipefs      (rw)
gvfs-fuse-daemon        on /root/.gvfs         type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
0                 on /bbb/b001          type ramfs         (rw)
0                 on /bbb/b002          type ramfs         (rw)

[root@localhost ~]# mkdir /bbb/b001/gtt
[root@localhost ~]# ll /aaa/
total 8
drwxr-xr-x. 2 root root 4096 2010-08-23 23:18 a001
drwxr-xr-x. 2 root root 4096 2010-08-23 23:18 a002
[root@localhost ~]# mount --bind /bbb/b001 /aaa
[root@localhost ~]# ll /aaa/
total 0
drwxr-xr-x. 2 root root 0 2010-08-23 23:21 gtt
[root@localhost ~]# mount -l
/dev/mapper/VolGroup-lv_root on /               type ext4         (rw)
proc                on /proc             type proc         (rw)
sysfs               on /sys              type sysfs         (rw)
devpts               on /dev/pts           type devpts        (rw,gid=5,mode=620)
tmpfs               on /dev/shm           type tmpfs         (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1             on /boot            type ext4         (rw)
none                on /proc/sys/fs/binfmt_misc type binfmt_misc      (rw)
sunrpc               on /var/lib/nfs/rpc_pipefs type rpc_pipefs      (rw)
gvfs-fuse-daemon        on /root/.gvfs         type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
0                 on /bbb/b001          type ramfs         (rw)
0                 on /bbb/b002          type ramfs         (rw)

/bbb/b001                    on /aaa                     type none                  (rw,bind)
[root@localhost ~]# umount /aaa
[root@localhost ~]# ll /aaa/
total 8
drwxr-xr-x. 2 root root 4096 2010-08-23 23:18 a001
drwxr-xr-x. 2 root root 4096 2010-08-23 23:18 a002

[root@localhost ~]# mount --make-slave /bbb/b001
[root@localhost ~]# mount --make-share /bbb/b002
[root@localhost ~]# mount --make-unbindable /bbb/b001
[root@localhost ~]# mount --make-private /bbb/b001

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

阅读(835) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~