环境

  • Red Hat Enterprise Linux

问题

  • We run start_udev as part of the storage allocation procedure that we have. It works, but it can be disruptive if an oracle DB instance is up and running (the listener interfaces briefly disappear). Our RH versions that we certified for SAN are 4u5, 4u8, 5.4 and 5.5.

  • If we don't run it, we don't get the multipath aliases show up in /dev/mapper directory - just the WWIDs.

  • The SAN folks want to know under what circumstances should start_udev be run?

决议

  • Nobody should ever run start_udev, only rc.sysinit should call start_udev.

RHEL6

  • If one has made a change and you don't want to reboot the system then can utilize udevadm trigger instead. Specify --type and --action or it will effectively work like start_udev.
 # /sbin/udevadm trigger --type=subsystems --action=add
# /sbin/udevadm trigger --type=devices --action=add

  

 # /sbin/udevadm trigger --type=subsystems --action=change
# /sbin/udevadm trigger --type=devices --action=change
  • One can even trigger only specific devices like below;
 # echo change > /sys/block/sda/sda1/uevent

  

RHEL5

  • To test the rule, use the udevtest command like so:
[root@rhel5 rules.d]# udevtest /block/sdc | grep mydevice
udev_rules_get_name: add symlink 'mydevice'
udev_node_add: creating symlink '/dev/mydevice' to 'sdc'
  • If /dev/sdc has partitions on it, run this command to test a device will be created for /dev/sdc1:
[root@rhel5 rules.d]# udevtest /block/sdc/sdc1 | grep mydevice
udev_rules_get_name: add symlink 'mydevice1'
udev_node_add: creating symlink '/dev/mydevice1' to 'sdc1'

Note: If an old udev package is installed, the symbolic link for each partition might not be created. In such a case, it should be added one more line which uses "all_partitions" option to the rule file:

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s %p", RESULT=="3600a0b800013275100000015427b625e", SYMLINK{all_partitions}+="mydevice%n"
  • Finally, echo change into the underlying device's uevent directory to have udev create the device(s):
[root@rhel5 rules.d]# echo change > /sys/block/sdc/uevent
[root@rhel5 rules.d]# echo change > /sys/block/sdc/sdc1/uevent
  • Verify that the device(s) /dev/mydevice have been created and are symbolic links to to /dev/sdc.
  • As long as the device with the unique identifier 3600a0b800013275100000015427b625e is attached/visible to Red Hat Enterprise Linux, it will always be statically bound to the name /dev/mydevice by udev.

根源

  • Here are some under the hood operations of start_udev which demonstrate the danger of running the start_udev command on a running production system.

    • start_udev copies the whole contents of /etc/udev/devices /lib/udev/devices to /dev, overwriting any modifications like permissions
    • start_udev kills the udevd daemon and restarts it, which could interrupt all currently processed udev events
    • start_udev triggers all devices on the system, so all disks are queried again, which causes heavy I/O, and some permissions might be reset
    • start_udev runs /sbin/restorecon, which resets all selinux labels in /dev

Under what conditions should the 'start_udev' command be run?的更多相关文章

  1. mongodb停止遇到shutdownServer failed: unauthorized: this command must run from localhost when running db without auth解决方法

    停止mongodb use admin db.shutdownServer(); mongos> db.shutdownServer(); assert failed : unexpected ...

  2. Could not determine which “make” command to run. Check the “make” step in the build configuration

    环境: QT5.10 VisualStudio2015 错误1: Could not determine which “make” command to run. Check the “make” s ...

  3. 【Supervisor】使用 Supervisor source command not found 如何解决

    结论: The source command is only available in bash, and the supervisor command is run by sh. I would r ...

  4. IAR Build from the command line 环境变量设置

    http://supp.iar.com/Support/?Note=47884 Technical Note 47884 Build from the command line The alterna ...

  5. 12 Linux Which Command, Whatis Command, Whereis Command Examples

    This Linux tutorial will explain the three "W" commands. The three "W"s are what ...

  6. How to execute sudo command in remote host via SSH

    Question: I have an interactive shell script, that at one place needs to ssh to another machine (Ubu ...

  7. [SSH] Intro to SSH command

    Create an ssh key: ssh-keygen Copy an SSH key to a remoate server: ssh-copy-id root@104.197.227.8 // ...

  8. Windbg 脚本命令简介 二, Windbg command

    Windbg  脚本命令简介 二, Windbg  script command $<, $><, $$<, $$><, $$>a< (Run Scri ...

  9. Docker Python API 与 Docker Command

    span.kw { color: #007020; font-weight: bold; } code > span.dt { color: #902000; } code > span. ...

随机推荐

  1. Scrapy框架(一)

    Scrapy框架(一) 国内镜像源: 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.c ...

  2. 代码管理平台之git

    yum install -y gitmkdir -p /date/gitrootcd !$git init git add 1.txtgit commit -m "add 1.txt&quo ...

  3. 面试连环炮系列(六):Dubbo应用为什么要部署Zookeeper

    Dubbo应用为什么要部署Zookeeper? Zookeeper用来注册和发现服务,简单说就是提供端注册接口信息到Zookeeper,调用端在Zookeeper上查找接口对应的服务IP和端口.由于Z ...

  4. 大数据理论篇 - 通俗易懂,揭秘谷歌《The Dataflow Model》的核心思想(一)

    目录 前言 目标 核心的设计原则 通用的数据处理流程 切合实际的解决方案 总结 延伸阅读 最后 作者:justmine 头条号:大数据达摩院 创作不易,未经授权,禁止转载,否则保留追究法律责任的权利. ...

  5. SpringCloud 亿级流量 架构演进

    疯狂创客圈 Java 高并发[ 亿级流量聊天室实战]实战系列 [博客园总入口 ] 架构师成长+面试必备之 高并发基础书籍 [Netty Zookeeper Redis 高并发实战 ] 前言 Crazy ...

  6. 算法设计与分析——n后问题(回溯法+位运算)

    一.问题描述 在n×n格的国际象棋上摆放n个皇后,使其不能互相攻击,即任意两个皇后都不能处于同一行.同一列或同一斜线上,问有多少种摆法. 二.算法设计 解n后问题的回溯算法描述如下: #include ...

  7. 文件上传报错:Unknown: file created in the system's temporary directory

    nginx+php下文件上传成功,但会有错误提示如下: <b>Notice</b>:  Unknown: file created in the system's tempor ...

  8. Cesium专栏-填挖方分析(附源码下载)

    Cesium 是一款面向三维地球和地图的,世界级的JavaScript开源产品.它提供了基于JavaScript语言的开发包,方便用户快速搭建一款零插件的虚拟地球Web应用,并在性能,精度,渲染质量以 ...

  9. 微信wxid搜索用户不存在,怎么加好友?

    点击上方↑↑↑蓝字[协议分析与还原]关注我们 " 根据wxid微信号找到用户的方法及周边资料大全." 最近经常会收到好友请求的消息提醒,但却不是通过搜索好友和群聊来添加的,因此研究 ...

  10. 设置UICollectionViewCell圆角和阴影

    设置cell圆角: cell.contentView.layer.cornerRadius =2.0f; cell.contentView.layer.borderWidth =1.0f; cell. ...