Show Table of Contents
A.5. devices
devices
子系统允许或者拒绝 cgroup 任务存取设备。
重要
设备白名单(Device Whitelist)(
devices
)子系统被视为 Red Hat Enterprise Linux 7 的“技术预览”。
Red Hat Enterprise Linux 7 订阅服务暂不支持 “技术预览” 功能,可能是由于功能还不完备,所以通常不适合生产使用。但 Red Hat 在操作系统中包含这些功能,为了方便用户并提供更多功能。您会发现这些功能可能在非生产环境中很有用,也请您提供反馈意见和功能建议,以便今后全面支持“技术预览”。
- devices.allow
- 指定 cgroup 任务可访问的设备。每个条目有四个字段:type、major、minor 和 access。type、major 和 minor 字段使用的值对应 〈Linux 分配的设备〉(也称为〈Linux 设备列表〉)指定的设备类型和节点数,如需此介绍,请访问 http://www.kernel.org/doc/Documentation/devices.txt。
- type
- type 的值有三种:
a
—— 可用于所有设备,“字符设备”和“块设备” 均可b
—— 指定一个块设备c
—— 指定一个字符设备
- major, minor
- major 和 minor 是〈Linux 分配的设备〉指定的设备节点数。major 数和 minor 数用冒号隔开。例如:
8
是指定 SCSI 磁盘驱动器的 major 数;1
是指定第一个 SCSI 磁盘驱动器中第一个分区的 minor 数;因此8:1
完整地指定该分区,与/dev/sda1
的一个文件系统位置对应。*
可代表所有主要或所有次要的设备节点,例如:9:*
(所有 RAID 设备)或者*:*
(所有设备)。 - access
- access 是以下一个或者多个字母的序列:
r
—— 允许任务从指定设备中读取w
—— 允许任务对指定设备写入m
—— 允许任务创建还不存在的设备文件
例如:当将 access 被指定为r
时,则任务只能从指定设备中读取,但将 access 指定为rw
时,则任务既可从该设备中读取,也可向该设备写入。
- devices.deny
- 指定 cgroup 任务无权访问的设备。条目语法与
devices.allow
一致。 - devices.list
- 报告 cgroup 任务对其访问受限的设备。
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.