• 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. mimetype: command not found
  2. How to Install apt-utils with apt-get?
  3. RPM : package installation Error : cpio: read failed
  4. mate-search-tool: command not found
  5. grub-install Command Examples in Linux
  6. tcptraceroute: command not found
  7. How to clear the buffer/pagecache (disk cache) under Linux
  8. gpasswd: command not found
  9. hdiutil Command Examples in Mac
  10. groupadd: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • cf: Command-line tool to manage apps and services on Cloud Foundry
  • certutil: Manage keys and certificates in both NSS databases and other NSS tokens
  • cdk: A CLI for AWS Cloud Development Kit (CDK)
  • cd: Change the current working directory

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright