理解mount -t proc proc /proc


mount 命令的标准用法是你说的这样:

mount -t type device dir

对于 proc 文件系统来说,它没有设备,然后我查了一下内核代码,proc filesystem 根本没有处理 dev_name 这个参数,所以传什么都没有影响,只影响你的 mount 命令输出。好的实践应该将设备名指定为 nodev。

static struct dentry *proc_mount(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *data)
{
        struct pid_namespace *ns;

        if (flags & MS_KERNMOUNT) {
                ns = data;
                data = NULL;
        } else {
                ns = task_active_pid_ns(current);
        }

        return mount_ns(fs_type, flags, data, ns, ns->user_ns, proc_fill_super);
}



免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM