• 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

Detect and Scan New Luns in CentOS/RHEL

by admin

While Working on the Linux boxes, sometimes the Linux admin has to scan new storage or LUNs assign to the server from the Storage team. In Redhat Linux and CentOS we can scan the LUNs either using the script ‘rescan-scsi-bus.sh’ or using the ‘/sys/class’ files without rebooting the server.

In my scenario, I have 4 FC (Fiber Channel) ports on the server, and new Luns are assigned on these ports. Follow the below steps to detect or scan new Luns.

Method 1

First Check the Fibre channels using the below Command:

# ls /sys/class/fc_host
host0  host1  host2  host3

Now Scan New luns using below Commands:

# echo "1" > /sys/class/fc_host/host0/issue_lip
# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "1" > /sys/class/fc_host/host1/issue_lip
# echo "- - -" > /sys/class/scsi_host/host1/scan
# echo "1" > /sys/class/fc_host/host2/issue_lip
# echo "- - -" > /sys/class/scsi_host/host2/scan
# echo "1" > /sys/class/fc_host/host3/issue_lip
# echo "- - -" > /sys/class/scsi_host/host3/scan

Method 2

The sg3_utils package provides the rescan-scsi-bus.sh script, this script scans new luns on redhat linux and CentOS. So to use this script first we have to install sg3_utils rpm.

# yum install sg3_utils
# ./rescan-scsi-bus.sh

Now the Check the newly discovered disks using ‘fdisk -l’ command or by ‘multipath -l’ command if configured.

# fdisk -l
# multipath -l

Filed Under: CentOS/RHEL

Some more articles you might also be interested in …

  1. How to Install RPM Package During Kickstart Installation
  2. Disk Encryption Using Network Based Key Services (NBDE) on CentOS/RHEL 8
  3. How to convert a Volume to Stripe (RAID0) Volume in LVM
  4. How to move /tmp on a separate disk as a separate mount point (Online)
  5. How to Troubleshoot Performance Issues on Linux – Beginners Guide
  6. How to Create and Manage Storage Domains in RedHat Virtualization (RHV)
  7. Integrate Linux Servers with Active Directory using Samba, Winbind, and Kerberos
  8. Yum Command – RPM Based Package Management Utility
  9. ‘error opening class fc_host’ – systool Command Error on CentOS/RHEL 7 and 8
  10. KVM Virsh Command Examples on CentOS and RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright