- 积分
- 145
- 鸿鹄币
- 个
- 好评度
- 点
- 精华
- 注册时间
- 2014-8-21
- 最后登录
- 1970-1-1
- 阅读权限
- 20
- 听众
- 收听
助理工程师
 
|
发表于 2018-5-1 21:56:35
|
显示全部楼层
SOLUTION UNVERIFIED - 已更新 2016年十二月6日23:49 - English
环境
Red Hat Enterprise Linux 7
问题
How to create raw devices in Red Hat Enterprise Linux 7?
How to create a disk partition without a filesystem, need it as raw device for database?
决议
RAW devices needs to be binded by /etc/udev/rules.d/60-raw.rules by following below procedure:
1. Create the raw devices using below udev rules:
Raw
# vi /etc/udev/rules.d/60-raw.rules
If you want to use device names, here is an example of the line that has to be written on the file above:
Raw
ACTION=="add", KERNEL=="<device name>", RUN+="/usr/bin/raw /dev/raw/rawX %N"
If you are using major / minor numbers of the device:
Raw
ACTION=="add", ENV{MAJOR}="A", ENV{MINOR}="B", RUN+="/usr/bin/raw /dev/raw/rawX %M %m"
For create persistent raw devices for single path LUNs, please do:
a) Check the LUN's WWID:
Raw
# /usr/lib/udev/scsi_id -g -u -d /dev/<device_name>
or,
Raw
# /usr/lib/udev/scsi_id --whitelisted --replace-whitespace /dev/<device_name>
b) Create persistent raw devices:
If using unpartitioned LUNs, to create a single raw device for the whole LUN use this rule format:
Raw
ACTION=="add", KERNEL=="sd*[!0-9]", PROGRAM=="scsi_id -g -u -d %N", RESULT=="1ATA_QEMU_HARDDISK_QM00002", RUN+="/usr/bin/raw /dev/raw/raw1 %N"
If using partitioned LUNs, where raw devices are created for each of the partitions on the LUN, use this rule format:
Raw
ACTION=="add", KERNEL=="sd*[0-9]", PROGRAM=="scsi_id -g -u -d %N", RESULT=="1ATA_QEMU_HARDDISK_QM00002", RUN+="/usr/bin/raw /dev/raw/raw%n %N"
2. Setting ownership and permissions on the raw devices:
Raw
ACTION=="add", KERNEL=="raw*", OWNER="root", GROUP="disk", MODE="0660"
3. Trigger the new udev rules:
Raw
# udevadm trigger --action=add
4. Check if the raw device(s) have been created:
Raw
# raw -qa
/dev/raw/raw1: bound to major 8, minor 17
# ls -l /dev/raw
total 0
crw-rw---- 1 root disk 162, 1 Jan 29 02:47 raw1
根源
N/A
产品(第) Red Hat Enterprise Linux 元件 udev 类别 Configure 标记 rhel_7
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
SOLUTION UNVERIFIED - 已更新 2016年十二月6日23:49 - English
环境
Red Hat Enterprise Linux 7
问题
How to create raw devices in Red Hat Enterprise Linux 7?
How to create a disk partition without a filesystem, need it as raw device for database?
决议
RAW devices needs to be binded by /etc/udev/rules.d/60-raw.rules by following below procedure:
1. Create the raw devices using below udev rules:
Raw
# vi /etc/udev/rules.d/60-raw.rules
If you want to use device names, here is an example of the line that has to be written on the file above:
Raw
ACTION=="add", KERNEL=="<device name>", RUN+="/usr/bin/raw /dev/raw/rawX %N"
If you are using major / minor numbers of the device:
Raw
ACTION=="add", ENV{MAJOR}="A", ENV{MINOR}="B", RUN+="/usr/bin/raw /dev/raw/rawX %M %m"
For create persistent raw devices for single path LUNs, please do:
a) Check the LUN's WWID:
Raw
# /usr/lib/udev/scsi_id -g -u -d /dev/<device_name>
or,
Raw
# /usr/lib/udev/scsi_id --whitelisted --replace-whitespace /dev/<device_name>
b) Create persistent raw devices:
If using unpartitioned LUNs, to create a single raw device for the whole LUN use this rule format:
Raw
ACTION=="add", KERNEL=="sd*[!0-9]", PROGRAM=="scsi_id -g -u -d %N", RESULT=="1ATA_QEMU_HARDDISK_QM00002", RUN+="/usr/bin/raw /dev/raw/raw1 %N"
If using partitioned LUNs, where raw devices are created for each of the partitions on the LUN, use this rule format:
Raw
ACTION=="add", KERNEL=="sd*[0-9]", PROGRAM=="scsi_id -g -u -d %N", RESULT=="1ATA_QEMU_HARDDISK_QM00002", RUN+="/usr/bin/raw /dev/raw/raw%n %N"
2. Setting ownership and permissions on the raw devices:
Raw
ACTION=="add", KERNEL=="raw*", OWNER="root", GROUP="disk", MODE="0660"
3. Trigger the new udev rules:
Raw
# udevadm trigger --action=add
4. Check if the raw device(s) have been created:
Raw
# raw -qa
/dev/raw/raw1: bound to major 8, minor 17
# ls -l /dev/raw
total 0
crw-rw---- 1 root disk 162, 1 Jan 29 02:47 raw1
根源
N/A
产品(第) Red Hat Enterprise Linux 元件 udev 类别 Configure 标记 rhel_7
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
SOLUTION UNVERIFIED - 已更新 2016年十二月6日23:49 - English
环境
Red Hat Enterprise Linux 7
问题
How to create raw devices in Red Hat Enterprise Linux 7?
How to create a disk partition without a filesystem, need it as raw device for database?
决议
RAW devices needs to be binded by /etc/udev/rules.d/60-raw.rules by following below procedure:
1. Create the raw devices using below udev rules:
Raw
# vi /etc/udev/rules.d/60-raw.rules
If you want to use device names, here is an example of the line that has to be written on the file above:
Raw
ACTION=="add", KERNEL=="<device name>", RUN+="/usr/bin/raw /dev/raw/rawX %N"
If you are using major / minor numbers of the device:
Raw
ACTION=="add", ENV{MAJOR}="A", ENV{MINOR}="B", RUN+="/usr/bin/raw /dev/raw/rawX %M %m"
For create persistent raw devices for single path LUNs, please do:
a) Check the LUN's WWID:
Raw
# /usr/lib/udev/scsi_id -g -u -d /dev/<device_name>
or,
Raw
# /usr/lib/udev/scsi_id --whitelisted --replace-whitespace /dev/<device_name>
b) Create persistent raw devices:
If using unpartitioned LUNs, to create a single raw device for the whole LUN use this rule format:
Raw
ACTION=="add", KERNEL=="sd*[!0-9]", PROGRAM=="scsi_id -g -u -d %N", RESULT=="1ATA_QEMU_HARDDISK_QM00002", RUN+="/usr/bin/raw /dev/raw/raw1 %N"
If using partitioned LUNs, where raw devices are created for each of the partitions on the LUN, use this rule format:
Raw
ACTION=="add", KERNEL=="sd*[0-9]", PROGRAM=="scsi_id -g -u -d %N", RESULT=="1ATA_QEMU_HARDDISK_QM00002", RUN+="/usr/bin/raw /dev/raw/raw%n %N"
2. Setting ownership and permissions on the raw devices:
Raw
ACTION=="add", KERNEL=="raw*", OWNER="root", GROUP="disk", MODE="0660"
3. Trigger the new udev rules:
Raw
# udevadm trigger --action=add
4. Check if the raw device(s) have been created:
Raw
# raw -qa
/dev/raw/raw1: bound to major 8, minor 17
# ls -l /dev/raw
total 0
crw-rw---- 1 root disk 162, 1 Jan 29 02:47 raw1
根源
N/A
产品(第) Red Hat Enterprise Linux 元件 udev 类别 Configure 标记 rhel_7
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form. |
1293#
2018-5-1 21:56:35
回复(0)
收起回复
|