使用udev管理asmdisk执行/sbin/scsi_id不显示UUID

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:155

不知道啥原因,死活显示不了UUID,执行结果是啥也不显示:
[root@udev ~]# /sbin/scsi_id -g -u -s /block/sdc
[root@udev ~]#
[root@udev ~]#
vmware的版本是:VMware-server-2.0.2-203138,有人说需要在虚拟机的vmx文件里加入:disk.EnableUUID="TRUE",我也尝试加入了,还是不起作用,不过建议加入disk.EnableUUID="TRUE"的貌似他们使用的vmware是workstation,不知道是不是和这个有关.
os的版本是:oracle linux 5u10
--=============================
没有uuid貌似没法配置udev rules文件,不过在一个哥们的帮助下最后通过这样的方式实现的,通过udevinfo命令获取分区的信息,可以利用分区中的这2项信息 SYSFS{start}=="63"和SYSFS{size}=="16771797"来代替uuid唯一标识这个设备:

[root@udev ~]# udevinfo -a -p /sys/block/sdc/sdc1Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device. looking at device '/block/sdc/sdc1':
KERNEL=="sdc1"
SUBSYSTEM=="block"
SYSFS{dev}=="8:33"
SYSFS{partition}=="1"
SYSFS{start}=="63"
SYSFS{size}=="16771797"
SYSFS{ro}=="0"
SYSFS{alignment_offset}=="0"
SYSFS{discard_alignment}=="0"
SYSFS{stat}==" 795 3743 9646 1252 518 1275 133113 15477 0 2601 16726"
SYSFS{inflight}==" 0 0" looking at parent device '/block/sdc':
ID=="sdc"
BUS=="block"
DRIVER==""
SYSFS{dev}=="8:32"
SYSFS{range}=="16"
SYSFS{ext_range}=="256"
SYSFS{removable}=="0"
SYSFS{ro}=="0"
SYSFS{size}=="16777216"
SYSFS{alignment_offset}=="0"
SYSFS{discard_alignment}=="0"
SYSFS{capability}=="50"
SYSFS{stat}==" 852 3876 11166 1262 518 1275 133113 15477 0 2611 16736"
SYSFS{inflight}==" 0 0"
SYSFS{events}==""
SYSFS{events_async}==""
SYSFS{events_poll_msecs}=="-1" looking at parent device '/devices/pci0000:00/0000:00:10.0/host0/target0:0:2/0:0:2:0':
ID=="0:0:2:0"
BUS=="scsi"
DRIVER=="sd"
SYSFS{device_blocked}=="0"
SYSFS{type}=="0"
SYSFS{scsi_level}=="3"
SYSFS{vendor}=="VMware, "
SYSFS{model}=="VMware Virtual S"
SYSFS{rev}=="1.0 "
SYSFS{state}=="running"
SYSFS{timeout}=="60"
SYSFS{iocounterbits}=="32"
SYSFS{iorequest_cnt}=="0x580"
SYSFS{iodone_cnt}=="0x580"
SYSFS{ioerr_cnt}=="0xd"
SYSFS{modalias}=="scsi:t-0x00"
SYSFS{evt_media_change}=="0"
SYSFS{dh_state}=="detached"
SYSFS{queue_depth}=="32"
SYSFS{queue_ramp_up_period}=="120000"
SYSFS{queue_type}=="simple" looking at parent device '/devices/pci0000:00/0000:00:10.0/host0/target0:0:2':
ID=="target0:0:2"
BUS=="scsi"
DRIVER==""
SYSFS{uevent}=="DEVTYPE=scsi_target" looking at parent device '/devices/pci0000:00/0000:00:10.0/host0':
ID=="host0"
BUS=="scsi"
DRIVER==""
SYSFS{uevent}=="DEVTYPE=scsi_host" looking at parent device '/devices/pci0000:00/0000:00:10.0':
ID=="0000:00:10.0"
BUS=="pci"
DRIVER=="mptspi"
SYSFS{vendor}=="0x1000"
SYSFS{device}=="0x0030"
SYSFS{subsystem_vendor}=="0x15ad"
SYSFS{subsystem_device}=="0x1976"
SYSFS{class}=="0x010000"
SYSFS{irq}=="17"
SYSFS{local_cpus}=="3"
SYSFS{local_cpulist}=="0-1"
SYSFS{modalias}=="pci:v00001000d00000030sv000015ADsd00001976bc01sc00i00"
SYSFS{numa_node}=="-1"
SYSFS{dma_mask_bits}=="64"
SYSFS{consistent_dma_mask_bits}=="64"
SYSFS{enable}=="1"
SYSFS{broken_parity_status}=="0"
SYSFS{msi_bus}==""
SYSFS{msi_irqs}=="" looking at parent device '/devices/pci0000:00':
ID=="pci0000:00"
BUS==""
DRIVER==""
SYSFS{uevent}==""[root@udev ~]#--=======================================
于是我创建的udev rules文件内容如下:
[root@udev rules.d]# pwd
/etc/udev/rules.d
[root@udev rules.d]# more 99-oracle-asmdevices.rules
KERNEL=="sdc1", SUBSYSTEM=="block", [backcolor=rgb(229, 51, 51)]SYSFS{size}=="16771797", SYSFS{start}=="63", NAME="asmdisk1-crs", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdd1", SUBSYSTEM=="block", [backcolor=rgb(229, 51, 51)]SYSFS{size}=="16771797", SYSFS{start}=="63", NAME="asmdisk2-data", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sde1", SUBSYSTEM=="block", [backcolor=rgb(229, 51, 51)]SYSFS{size}=="16771797", SYSFS{start}=="63", NAME="asmdisk3-fra", OWNER="grid", GROUP="asmadmin", MODE="0660"

其他的都好办了,正常安装就可以了.

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】