• 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 scan newly Assigned LUNs in Multipathd under CentOS / RHEL

by admin

After you have assigned a new disk/LUN from storage to the designated server, you have to follow few steps in order to scan the new LUN and make it visible on the server. Before you can configure the LUN in multipath configuration, you will have to scan it in OS first. Follow the steps below to scan the new LUN in OS and then in multipath.

1. Rescan SCSI hosts:

# for host in 'ls /sys/class/scsi_host'
do 
	echo ${host}; echo "- - -" > /sys/class/scsi_host/${host}/scan
done

2. Issue LIP to FC hosts:

# for host in 'ls /sys/class/fc_host'
do 
	echo ${host}; echo "1" > /sys/class/fc_host/${host}/issue_lip;
done
Note: Performing issue_lip is not recommended to scan the newly added devices on existing storage ports. This operation performs a Loop Initialization Protocol (LIP), scans the interconnect, and causes the SCSI layer to be updated to reflect the devices currently on the bus. Essentially, an LIP is a bus reset, and causes device addition and removal.

3. Run rescan script from sg3_utils:

# rescan-scsi-bus.sh
# rescan-scsi-bus.sh -i

Reload/Refresh Multipathd deamon

After above scan, the new assigned LUNs are visible in Linux OS level, but still multipathd daemon will show no mappings for new LUNs. You will have to refresh multipathd daemon to map the new LUNs.

Run the below command:

# multipath -v2

This should bring the LUNs in control of device mapper multipathd.

Verify

Verify with “multipath -ll“” that the LUNs are visible now.

# multipath -ll

If partitions created on multipath devices and that is not being listed, kpartx need to be executed on the affected multipath devices.

# kpartx -a -v /dev/mapper/XXXXXXX

After running the above command you should be able to see the partition.

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

Some more articles you might also be interested in …

  1. ansible-playbook: command not found
  2. ss: command not found
  3. sysctl Command Examples in Linux
  4. CentOS / RHEL 5 : How to disable device mapper multipath (dm-multipath)
  5. How to mount and umount a file system in Linux
  6. Linux OS service ‘portmap’
  7. How to create an XFS Filesystem
  8. bmon Command Examples in Linux
  9. How to Resize / Expand a Btrfs Volume / Filesystem
  10. pwd Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright