理解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);
}


懒惰不会让你一下子跌到 但会在不知不觉中减少你的收获; 勤奋也不会让你一夜成功 但会在不知不觉中积累你的成果 越努力,越幸运。
原文地址:https://www.cnblogs.com/Rainingday/p/15016470.html