• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to blacklist a local disk using the “find_multipaths” directive in CentOS/RHEL 6

by admin

After a system reboot, locally attached disks (eg /dev/sda1) are assigned device mapper multipath (“dm-multipath”, “dm-mp”) names (e.g. /dev/mapper/mpath1p1). Any SCSI device for that matter, which has a scsi ID and is not OPEN/mounted, will be assigned by dm-multipath during boot process unless blacklisted in multipath configuration.

Follow the stpes outlined below in order to blacklist a local disk using the “find_multipaths” directive:

1. Find the WWID of the internal drive which you do not want to be created as a multipath device.

$ sudo multipath -ll
 [WWN_ID-4]
$ sudo /lib/udev/scsi_id --whitelisted --device=/dev/sd[X]  
 [WWN_ID-4]

2. Remove any reference of this WWID from /etc/multipath/wwids and /etc/multipath/bindings:

$ sudo vi /etc/multipath/wwids
  # Valid WWIDs:
  /[WWN_ID-0]/
  /[WWN_ID-1]/
  /[WWN_ID-2]/
  /[WWN_ID-3]/
  /[WWN_ID-4]/ <<<<<
  /[WWN_ID-5]/

3. Add "find_multipaths yes" to "defaults" OR device specific section in /etc/multipath.conf.

$ sudo vi /etc/multipath.conf
defaults {
	user_friendly_names yes
	find_multipaths yes
}

At this point you would need to plan a downtime and reboot the host to make sure that multipath is not assigning the internal drive.Please note that in some cases you might have to rebuild the initrd too. This is required if initramfs was built with dm-multipath support (e.g. if "Boot From SAN" support has been added).

a) Make a backup copy of the initrd in case the new version has an unexpected problem. Ensure /boot is mounted:

$ df -h
$ sudo cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.`date +%Y-%m-%d-%H.%M.%S`

b) Rebuild the initramfs for the current kernel version:

$ sudo dracut -f
Note: Another commonly used method to blacklist a device is by using blacklist stanza in the /etc/multipath.conf file.

Filed Under: CentOS/RHEL, CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. Understanding How an Email System Works
  2. How to Change Kernel Semaphore Limits in CentOS/RHEL
  3. Understanding The /proc File System
  4. Search XML Attributes PowerShell XPath
  5. How To Add New Disk to An Existing Diskgroup on RAC Cluster or Standalone ASM Configuration
  6. User Unable To Edit crontab, Error: “/tmp/crontab.Lm34gsJV: Permission denied”
  7. CentOS / RHEL : How to prioritize the devices used for swap partition
  8. CentOS / RHEL 7 : How to change runlevels (targets) with systemd
  9. How to set “max_report_luns” and “max_luns” on CentOS/RHEL 6 to scan more than 512 LUNs
  10. How to Configure Password Expiration and Complexity Requirements in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright