How to blacklist external hard drive taken by multipath

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Issue

External hard driver can not be mounted because it has been taken by multipath

Resolution

  • Edit the blacklist section in /etc/multipath.conf  and add the device section with the vendor and model  indicated in /var/log/messages :

        blacklist { 
        
          ......
      
            device {
                    vendor Generic
                    model External
            }
          }
    
  • Reload multipath configuration

# service multipathd reload
  • Connect the external hard drive and check if it can be mounted

Root Cause

There is no blacklist in multipath configuration for the device that is connected

Diagnostic Steps

We can check in /var/log/messages what happens when the device is connected :

  Jan 10 09:47:15 hostname1 kernel:   Vendor: Generic   Model: External          Rev: 2.12              <--------------------------- Information about Vendor and Model
  Jan 10 09:47:15 hostname1 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 04
  Jan 10 09:47:15 hostname1 kernel: SCSI device sday: 1953525168 512-byte hdwr sectors (1000205 MB)
  Jan 10 09:47:15 hostname1 kernel: sday: Write Protect is off
  Jan 10 09:47:15 hostname1 kernel: sday: assuming drive cache: write through
  Jan 10 09:47:15 hostname1 kernel: SCSI device sday: 1953525168 512-byte hdwr sectors (1000205 MB)
  Jan 10 09:47:15 hostname1 kernel: sday: Write Protect is off
  Jan 10 09:47:15 hostname1 kernel: sday: assuming drive cache: write through
  Jan 10 09:47:15 hostname1 kernel:  sday: sday1
  Jan 10 09:47:15 hostname1 multipathd: sday: add path (uevent)                <--------------------------- Here multipath takes the device
  Jan 10 09:47:15 hostname1 kernel: sd 12:0:0:0: Attached scsi disk sday
  Jan 10 09:47:15 hostname1 kernel: sd 12:0:0:0: Attached scsi generic sg57 type 0
  Jan 10 09:47:16 hostname1 multipathd: 1Generic_External_: load table [0 1953525168 multipath 0 0 1 1 round-robin 0 1 1 67:32 1000] 
  Jan 10 09:47:16 hostname1 multipathd: 1Generic_External_: event checker started 
  Jan 10 09:47:16 hostname1 multipathd: dm-16: add map (uevent) 
  Jan 10 09:47:16 hostname1 multipathd: dm-16: devmap already registered 
  Jan 10 09:47:16 hostname1 multipathd: dm-17: add map (uevent)
SBR

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.