Under what conditions should the 'start_udev' command be run?
环境
- 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, onlyrc.sysinitshould callstart_udev. 
RHEL6
- If one has made a change and you don't want to reboot the system then can utilize 
udevadm triggerinstead. Specify--typeand--actionor it will effectively work likestart_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/sdchas 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 
3600a0b800013275100000015427b625eis 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?的更多相关文章
- 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 ...
 - 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 ...
 - 【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 ...
 - IAR Build from the command line 环境变量设置
		
http://supp.iar.com/Support/?Note=47884 Technical Note 47884 Build from the command line The alterna ...
 - 12 Linux Which Command, Whatis Command, Whereis Command Examples
		
This Linux tutorial will explain the three "W" commands. The three "W"s are what ...
 - 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 ...
 - [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 // ...
 - Windbg  脚本命令简介 二, Windbg command
		
Windbg 脚本命令简介 二, Windbg script command $<, $><, $$<, $$><, $$>a< (Run Scri ...
 - Docker Python API 与 Docker Command
		
span.kw { color: #007020; font-weight: bold; } code > span.dt { color: #902000; } code > span. ...
 
随机推荐
- 分布式图数据库 Nebula RC2 发布:增强了 CSV Importer 功能
			
Nebula Graph 是开源的分布式图数据库,可应用于知识图谱.社交推荐.风控.IoT 等场景. 本次 RC2 主要新增 GO FROM ... REVERSELY 和 GROUP BY 等语句, ...
 - WPF 后台模拟界面触摸点击
			
win32Api提供一种方法,模拟用户触摸点击 InjectTouchInput function InitializeTouchInjection InjectTouchInput 在模拟添加触摸输 ...
 - go 中recover捕获异常
			
recover 仅在延迟函数 defer 中有效,在正常的执行过程中,调用 recover 会返回 nil 并且没有其他任何效果.重要的事再说一遍:仅当在一个defer函数中被完成时,调用recove ...
 - 头条小视频和西瓜视频signature签名算法
			
点击上方↑↑↑蓝字[协议分析与还原]关注我们 "分析今日头条内小视频和西瓜视频分享后浏览器打开所用的signature签名算法." 上月写的一篇关于使用微信的wxid加好友的文章, ...
 - DomDom: 1 Vulnhub Walkthrough
			
主机层面扫描: ╰─ nmap -p1-65535 -A -sV 10.10.202.140 You name 存在XSS 漏洞 右键源码有隐藏form表单 修改其type属性为:text 尝试了SQ ...
 - 更新阿里yum源并重建缓存
			
[第一种方式]1.下载安装wget /如果没有装的话yum install -y wget 2.备份默认的yummv /etc/yum.repos.d /etc/yum.repos.d.backup ...
 - DSP程序中的布尔类型使用
			
在DSP程序中,布尔类型不能直接拿来用,要定义一下,可以通过定义为枚举类型来定义: typedef enum{FALSE=0,TRUE} BOOL; 一般枚举类型的定义是这样的:enum [枚举名] ...
 - centos7中安装python3.6.4
			
1.在安装Python之前,需要先安装一些后面遇到的依赖问题(如果有依赖问题,按照提示安装): yum -y install zlib-devel bzip2-devel openssl-devel ...
 - json属性里面出现特殊字符怎么获取属性
			
直接上代码. 这样的 获取这个object后需要获取里面的书属性,但是正常情况下是XX.属性名.但是属性名有特殊符号.这时候我们可以这样. XX['属性名']['属性名']....可以一直这样写 XX ...
 - redis 开源客户端下载
			
redis 开源客户端下载地址: https://github.com/qishibo/AnotherRedisDesktopManager/releases