mount命令里的bind选项 (完)
时间:2005-10-28 来源:hppyhjh
mount显示:
/dev/mtdblock0 on /flash type jffs2 (rw)
/dev/mtdblock0 on /etc type jffs2 (rw)
看到的现象是这样,我们再看一看启动脚本,为什么是这样:
先是mount /dev/mtdblock0 /flash
然后看一下/flash里内容,有一个目录 etc
然后mount --bind /flash/etc /etc
这样/etc里的内容就是/flash/etc里的内容了
用的linux是uClinux,image里包含了kernel+rootfs,当然也有/etc配置目录
这样处理的用处,大约是:
如果mtdblock0分区上已有etc配置文件,则不使用自带的
如果没有,则将其copy到mtdblock0上
下面是man mount对bind选项的说明:
Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else. The call is
mount --bind olddir newdir
After this call the same contents is accessible in two places.
/dev/mtdblock0 on /flash type jffs2 (rw)
/dev/mtdblock0 on /etc type jffs2 (rw)
看到的现象是这样,我们再看一看启动脚本,为什么是这样:
先是mount /dev/mtdblock0 /flash
然后看一下/flash里内容,有一个目录 etc
然后mount --bind /flash/etc /etc
这样/etc里的内容就是/flash/etc里的内容了
用的linux是uClinux,image里包含了kernel+rootfs,当然也有/etc配置目录
这样处理的用处,大约是:
如果mtdblock0分区上已有etc配置文件,则不使用自带的
如果没有,则将其copy到mtdblock0上
下面是man mount对bind选项的说明:
Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else. The call is
mount --bind olddir newdir
After this call the same contents is accessible in two places.
相关阅读 更多 +