When a new SCSI device is installed in Rhel 6, a disk drift may occur, such as the original system disk is/DEV/SDA, add new device, restart the system, the letter to the last, such as/DEV/SSDA.
The reason for the drift of disk character
In the Linux kernel, the SCSI hard drive letter assignment is related to the drive scan to the hard disk sequence, that is, the first scan to the hard drive letter is/DEV/SDA, the second disk letter is/dev/sdb ... by analogy.
In general, the sequence of drive-scanned hard disks is related to the sequence of different types of Sas/raid controller driver loading. If the Megaraid_sas driver is loaded first, the hard drive under the RAID controller assigns the letter first, that is, the/DEV/SDA's corresponding hard disk is under the RAID controller. If the FC driver is loaded first, the hard drive below FC will get the letter first, at which point the/DEV/SDA is on the hard drive under the FC controller.
RHEL 6 system, after adding a new device, the reason for the disk drift is the Sas/raid controller driver load sequence changed. The loading sequence is the UDEV mechanism configuration file decision.
Disk Drift Solution
In the Intramfs kernel boot file, we can see the boot script 01parse-kernel.sh in the cmdline/directory. The script is executed before the driver is loaded through the udev mechanism. In this script, you can see parsing kernel parameter rdloaddriver, that is, the kernel first loads the rdloaddriver in the parameter.
The code is as follows |
Copy Code |
[root@rh2285 cmdline]# ls 01parse-kernel.sh 10parse-resume.sh 20parse-blacklist.sh 30parse-crypt.sh 30parse-lvm.sh 01version.sh 10parse-root-opts.sh 20parse-i18n.sh 30parse-dmsquash-live.sh 95parse-block.sh [root@rh2285 cmdline]# [root@rh2285 cmdline]# Cat 01parse-kernel.sh #!/bin/sh For P in $ (Getargs rdloaddriver=); Todo Modprobe $p Done |
The drive load sequence can be carried out on the machine where the disk is drifting. If the Megaraid_sas driver is loaded first, then the qla4xxx driver is loaded.
The code is as follows |
Copy Code |
Title Red Hat Enterprise Linux Server (2.6.32-220.el6.x86_64) Root (hd0,2) kernel/boot/vmlinuz-2.6.32-220.el6.x86_64 ro rdloaddriver=megaraid_sasrdloaddriver=qla4xxx root=UUID= d44cb995-39d0-4882-a25b-43803b3b9d4b Initrd/boot/initramfs-2.6.32-220.el6.x86_64.img |