环境

  • 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. React: 通过React.Children访问特定子组件

    一.简介 React中提供了很多常用的API,其中有一个React.Children可以用来访问特定组件的子元素.它允许用来统计个数.map映射.循环遍历.转换数组以及显示指定子元素,如下所示: va ...

  2. 50道Redis面试题史上最全,以后面试再也不怕问Redis了

    1.什么是Redis? Redis本质上是一个Key-Value类型的内存数据库,很像memcached,整个数据库统统加载在内存当中进行操作,定期通过异步操作把数据库数据flush到硬盘上进行保存. ...

  3. WebMvcConfigurationSupport 避坑指南

    通过返回WebMvcConfigurationSupport 的方式, 默认会覆盖 Spring boot的自动配置, 导致配置失效静态资源无法访问:但是在WebMvcConfigurationadp ...

  4. 文件系统常用命令与fdisk分区

    一.硬盘结构 1.硬盘的逻辑结构 硬盘的大小是使用"磁头数×柱面数×扇区数×每个扇区的大小"这样的公式来计算的.其中磁头数(Heads)表示硬盘总共有几个磁头,也可以理解成为硬盘有 ...

  5. Nacos Cluster Building

    原文链接:https://www.javaspring.net/nacos/nacos-cluster-building Continue to talk about the Nacos build ...

  6. sqlserver 标准系统数据库

    SQL server系统数据库很重要,大部分时候都不应该修改他们.唯一例外的是model数据库和tempdb数据库.model数据库允许部署更改到任何新创建的数据库(如存储过程),而更改tempdb数 ...

  7. 微信小程序的入门

    1.申请账号     官网:https://mp.weixin.qq.com/  2.开发工具      为了帮助开发者简单和高效地开发和调试微信小程序,推出了小程序开发者工具,集成了公众号网页调试和 ...

  8. 1.1 菜单管理 ——MyRapid WinForm快速开发框架-功能介绍

    菜单表数据库设计 可以根据数据表取得树状目录,其中 版本和作者 可以分别对版本和修改人进行追溯 有兴趣的朋友可以尝试再添加一个收藏夹   也是比较常用的功能   这里我没有做这个功能 然后看下菜单编辑 ...

  9. Chrome 开发者工具实用操作

    Chrome 开发者工具实用操作 https://umaar.com/dev-tips/

  10. django-xadmin自定义widget插件(自定义详情页字段的显示样式)

    有时候我们想要修改xadmin详情页字段的显示方式,比如django默认的ImageField在后台显示的是image的url,我们更希望看到image的缩略图:再比如django将多对多字段显示为多 ...