环境

  • 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. 《Hands-On System Programming with Go》之写文件的代码模板

    使用了buffer,这个神奇东东. var w io.WriteCloser // initialise writer defer w.Close() b := bufio.NewWriter(w) ...

  2. Nacos 安装(带视频)

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

  3. Prometheus学习系列(四)之Prometheus 配置说明

    前言 本文来自Prometheus官网手册 和 Prometheus简介 说明 Prometheus通过命令行和配置文件进行配置,命令行配置不能修改的系统参数(例如存储位置,要保留在磁盘和内存中的数据 ...

  4. IPIP.net识别客户端真实访问地址,具体到国家,省,市

    这个IP库实测还是比较准确的,免费版的可以具体到国内城市,国外只能到国家名称,免费版的自己定期更新Ip数据库即可. 以下为C#调用代码 class Program { static void Main ...

  5. create connection SQLException, url: jdbc:mysql://localhost:3306/demo, errorCode 1045, state 28000

    错误原因: 配置文件中 username 与 Mysql 关键字冲突 改为:

  6. phpstudy漏洞检测

    后门检测脚本 # !/usr/bin/env python # -*- coding:utf-8 -*- import gevent from gevent import monkey gevent. ...

  7. Python基础语法-List

    列表的操作方法 列表中存放的数据是可以进行修改的,比如"增"."删"."改"" 添加元素("增" append ...

  8. i2c中start和restart的区别【转】

    有的硬件芯片提供了一个个寄存器,供我们很好的操作i2c,但是,在用的时候,我们是不知道他到地是怎么操作的,下边,我就探讨下i2c中的start和restart的区别. start是在scl是高电平的时 ...

  9. 【学习笔记】《Java编程思想》 第1~7章

    第一章 对象导论 对整书的概要. 略读. 第二章 一切都是对象 创建一个引用,指向一个对象. 安全的做法:创建一个引用的同时便进行初始化. 对象存储的地方:1)寄存器:这是最快的存储区,因为它位于不同 ...

  10. nginx基础(1)

    目录 一.概念 基础概念 响应码 请求和响应报文的格式 http无连接 我叫张贺,贪财好色.一名合格的LINUX运维工程师,专注于LINUX的学习和研究,曾负责某中型企业的网站运维工作,爱好佛学和跑步 ...