使用UDEV繫結裝置名
UUID的獲取方法:
1、 ls -l /dev/disk/by-uuid/
2、 blkid
3、scsi_id -g -s /block/sdc
Red Hat Enterprise Linux ES 4 (x86) - How To Create Persistent Device Names Using UDEV
Information
In cases where we need to assign a persistent device name to a LUN or a tape device, udev comes handy. Applicable to RHEL4 only as udev is found in RHEL4 and later.
Details
Instead of udev assigning a device name at the time of booting, we can assign persistent device name using the UUID of the device. Steps are as follows:
- To allow udev to acquire the UUIDs for device,
edit /etc/scsi_id.config and change the "options=-b" line to:"options=-g"
This tells udev to assume that all the SCSI devices on the system will return a UUID.
- To get the UUID, run this command:
# scsi_id -g -s /block/sdc
The output will look something like the following:
[root@devices]# scsi_id -g -s /block/sdc
3600a0b800013275100000015427b625e
The result (the long string of characters) will be the UUID. Verify that the UUID ID is the same for each path to the device. The UUID is what the device names will be keyed off of. UUIDs do not change if a device is added to the system.
- Now, rules need to be created for naming the device. Create the /etc/udev/rules.d/20-names.rules file.
Within this file, the naming rule will be added. Any subsequent rules will be added in this file with the same format.
Rules should have the following format:
KERNEL="sd*", BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="UUID", NAME="devicename%n"
Replace UUID and device-name with the UUID retrieved above, and the desired name for the device. In the example, the rule would look as follows:
KERNEL="sd*", BUS="scsi", PROGRAM="/sbin/scsi_id", RESULT="3600a0b800013275100000015427b625e", NAME="mydevice"
This will cause the system to check all devices which match /dev/sd* to be checked for the given UUID. When it finds a matching device, it will create a device node named /dev/devicename. In this example, the device node would be /dev/mydevice.
To confirm that the rule is working correctly, run
The device should appear as /dev/mydevice
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22531473/viewspace-742483/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux使用udev繫結裸裝置Linuxdev
- 在Linux中使用UDEV繫結裝置Linuxdev
- linux udev裸裝置繫結Linuxdev
- Redhat7 Udev繫結(DM multipath)多路徑裝置Redhatdev
- Redhat7 Udev繫結單路徑裝置方法Redhatdev
- 【轉】在RHEL5上,使用udev給SCSI裝置分配靜態裝置名dev
- ubuntu 為USB串列埠繫結固定的裝置名Ubuntu串列埠
- Linux 7下使用udev繫結ASM磁碟LinuxdevASM
- udev 裸裝置 安裝racdev
- udev+multipath配合繫結磁碟dev
- OEL5.7 UDEV繫結磁碟dev
- Oracle 在asm前使用udev繫結共享儲存OracleASMdev
- linux下udev重新繫結磁碟Linuxdev
- rhel 5.5UDEV繫結asm磁碟devASM
- LINUX裸裝置取消繫結Linux
- rhel 7.x 使用 udev scsi rules 配置裸裝置dev
- 使用 udev 高效、動態地管理 Linux 裝置檔案devLinux
- 使用udev高效、動態的管理Linux裝置檔案devLinux
- 關於oracle RAC 通過udev繫結磁碟Oracledev
- 關於oracle RAC 透過udev繫結磁碟Oracledev
- [zt] LINUX裸裝置(raw)取消繫結Linux
- Oracle Linux 7.8 多路徑(Multipath)+Udev繫結磁碟OracleLinuxdev
- ORACLE LINUX 5.5 UDEV繫結asm磁碟問題OracleLinuxdevASM
- 12C__單機安裝Grid+Oracle的方法,ASM使用UDEV進行磁碟繫結OracleASMdev
- 定位器裝置繫結新增手機號欄位
- 利用UDEV管理Linux塊裝置,並分配ASM使用 (文件 ID 1528148.1)devLinuxASM
- wordpress修改繫結的mysql使用者名稱密碼MySql密碼
- 磁帶裝置使用方法總結
- 使用udev(轉)dev
- 《CiscoASA裝置使用指南》一1.4 總結
- 裝置樹總結
- Linux裝置名稱的查詢Linux
- 各家儲存在OS的裝置名稱 ?
- PLSQL使用繫結變數SQL變數
- 【優化】使用繫結變數 OR 不使用繫結變數,這不是問題!優化變數
- IOS檢視包名、版本號、裝置資訊、簽名、程式IDiOS
- 【最佳化】使用繫結變數 OR 不使用繫結變數,這不是問題!變數
- Linux 修改網路卡裝置名(interface name)Linux