环境

  • 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. Builder模式的目的是解耦构建过程,为什么要用内部类?

    还没有看过Builder模式的作用,看过一篇介绍Builder模式的文章,这里是关于Builder模式的思考:思考是否有比新建一个内部类更好的方法,首先想到的是 package xyz.n490808 ...

  2. jQuery插件 distpicker实现多次赋值

    项目里需要实现省市区联动选择功能,使用了一个jQuery插件dispicker,记录一下使用过程中遇到的问题和解决办法. 需要要实现的功能就两个:打开modal框时设置地址,点击重置按钮时重置地址 原 ...

  3. 计算几何 val.2

    目录 计算几何 val.2 几何单位结构体板子 旋转卡壳 基础概念 求法 模板 半平面交 前置芝士:线段交 S&I算法 模板 最小圆覆盖 随机增量法 时间复杂度 模板 后记 计算几何 val. ...

  4. Python高级特性——生成器(generator)

    通过上节的学习,我们知道使用列表生成式,可以直接创建一个列表.但是,有些时候,受到内存的限制等实际情况,列表生成式无法满足.比如,一个长度为1000万的列表,普通内存根本就不够,又或者实际处理的过程中 ...

  5. Additional information: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding elemen

    wcf service: <system.serviceModel> <bindings> <basicHttpBinding> <binding name= ...

  6. English:2019100401_Suffix"ery"

    Ax_introduction source a Frech mean to "state,quality,act,place where etc" 1)After the ver ...

  7. Redis & memcached PK

    redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set ...

  8. Java8_map新增方法

    参考博客 https://irusist.github.io/2016/01/04/Java-8%E4%B9%8BMap%E6%96%B0%E5%A2%9E%E6%96%B9%E6%B3%95/#ge ...

  9. 上手OrangePi Zero+

    一.安装系统 所需材料:系统镜像文件.镜像烧录工具.至少2G的内存卡(推荐8G以上).读卡器 1.下载系统镜像 官方系统下载地址,由于官方系统更新截止到17年,所以我选择的是Armbian系统.下载地 ...

  10. laravel中间件的使用

    简介HTTP 中间件提供了为过滤进入应用的 HTTP 请求提供了一套便利的机制.例如,Laravel 内置了一个中间件来验证用户是否经过授权,如果用户没有经过授权,中间件会将用户重定向到登录页面,否则 ...