SUSE Linux uses Udev configuration Asmdisk

Source: Internet
Author: User

node1:~ # Cat/etc/issue

Welcome to SUSE Linux Enterprise Server SP2 (x86_64)-Kernel \ R (\l).
node1:~ #

NODE1:/ETC/UDEV/RULES.D # Fdisk-l

disk/dev/sda:42.9 GB, 42949672960 bytes
255 heads, Sectors/track, 5221 cylinders, total 83886080 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x000b4c72

   Device boot      start         end      blocks   id  System
/dev/sda1   *         2048      401407      199680    83  Linux
/dev/sda2          401408      8787967     4193280   82  Linux swap/solaris
/dev/sda3          8787968    83859455    37535744   83   Linux

disk/dev/sdb:2097 MB, 2097152000 bytes
Heads, Sectors/track, 1016 cylinders, Total 4096000 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/sdb doesn ' t contain a valid partition table

disk/dev/sdc:10.5 GB, 10485760000 bytes
Heads, Sectors/track, 10000 cylinders, total 20480000 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

DISK/DEV/SDC doesn ' t contain a valid partition table

disk/dev/sdd:21.0 GB, 20971520000 bytes
Heads, Sectors/track, 20000 cylinders, total 40960000 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

DISK/DEV/SDD doesn ' t contain a valid partition table
NODE1:/ETC/UDEV/RULES.D #


Add Edit/etc/scsi_id.config File
Options=--whitelisted--replace-whitespace

Add Edit/etc/udev/rules.d/99-oracle-asmdevices.rules
node1:~ # for I in B c D
> Do
> echo "kernel==\" sd*\ ", subsystem==\" Block\ ", program==\"/lib/udev/scsi_id--whitelisted--replace-whitespace-- Device=/dev/\

$name \ ", result==\" '/lib/udev/scsi_id--whitelisted--replace-whitespace--device=/dev/sd$i ' \ ", NAME=\" Asm-disk$i\ " , owner=\ "grid

\ ", group=\" asmadmin\ ", mode=\" 0660\ ""
> Done
kernel== "sd*", subsystem== "block", program== "/lib/udev/scsi_id--whitelisted--replace-whitespace--device=/dev/$ Name ",

result== "2e8ced45878991f7f", name= "ASM-DISKB", owner= "grid", group= "Asmadmin", mode= "0660"
kernel== "sd*", subsystem== "block", program== "/lib/udev/scsi_id--whitelisted--replace-whitespace--device=/dev/$ Name ",

result== "2FF5DD7058B0FFB40", name= "ASM-DISKC", owner= "grid", group= "Asmadmin", mode= "0660"
kernel== "sd*", subsystem== "block", program== "/lib/udev/scsi_id--whitelisted--replace-whitespace--device=/dev/$ Name ",

result== "26c6d14a2e3aa5dd4", name= "ASM-DISKD", owner= "grid", group= "Asmadmin", mode= "0660"

Modify the device alias to the desired device name.
node1:~ # cd/etc/udev/rules.d/
NODE1:/ETC/UDEV/RULES.D # VI 99-oracle-asmdevices.rules
kernel== "sd*", subsystem== "block", program== "/lib/udev/scsi_id--whitelisted--replace-whitespace--device=/dev/$ Name ",

result== "2e8ced45878991f7f", name= "ASMOCR", owner= "grid", group= "Asmadmin", mode= "0660"
kernel== "sd*", subsystem== "block", program== "/lib/udev/scsi_id--whitelisted--replace-whitespace--device=/dev/$ Name ",

result== "2FF5DD7058B0FFB40", name= "Asmfra", owner= "grid", group= "Asmadmin", mode= "0660"
kernel== "sd*", subsystem== "block", program== "/lib/udev/scsi_id--whitelisted--replace-whitespace--device=/dev/$ Name ",

result== "26c6d14a2e3aa5dd4", name= "Asmdata", owner= "grid", group= "Asmadmin", mode= "0660"
~
"99-oracle-asmdevices.rules" 3L, 625C written
NODE1:/ETC/UDEV/RULES.D #

Unlike the SuSE and Redhat series, you need to use the UDEVADM test to see the newly generated device name.

NODE1:/ETC/UDEV/RULES.D # Udevadm Test/sys/block/sdb
NODE1:/ETC/UDEV/RULES.D # Udevadm TEST/SYS/BLOCK/SDC
NODE1:/ETC/UDEV/RULES.D # Udevadm TEST/SYS/BLOCK/SDD

Restart Udev (make sure Udev is running)
NODE1:/ETC/UDEV/RULES.D #/etc/init.d/boot.udev Restart
Restarting Udevd:done
NODE1:/ETC/UDEV/RULES.D #
View the generated device name
Node1:/dev # ll asm*
BRW-RW----1 grid asmadmin 8, 23:11 asmdata
BRW-RW----1 grid asmadmin 8, 23:11 Asmfra
BRW-RW----1 grid asmadmin 8, 23:11 ASMOCR
Node1:/dev #


Note: Online viewing to the data using UDEVADM test fdisk-l will not see the disk, but I test, if the UDEVADM test command after testing the execution of fdisk-l, except the system disk itself is not visible, as follows:

node1:~ # Fdisk-l

disk/dev/sda:42.9 GB, 42949672960 bytes
255 heads, Sectors/track, 5221 cylinders, total 83886080 sectors
Uni TS = sectors of 1 * bytes = Sector size (logical/physical): bytes/512 bytes
I/o size (minimum/optimal) : bytes/512 bytes
Disk identifier:0x000b4c72

Device Boot Start End Blocks Id System
/DEV/SDA1 * 2048 401407 199680 Linux
/dev/sda2 401408 8787967 4193280, Linux Swap/solaris
/dev/sda3 8787968 83859455 37535744-up Linux
node1:~ #

However, after rebooting, it is possible to see that some disks exist but do not affect their use. This point also needs to understand the friend pointing.


This article is from "Technical achievement dream!" "Blog, be sure to keep this provenance http://dreamsanqin.blog.51cto.com/845412/1653889

SUSE Linux uses Udev configuration Asmdisk

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.