Greetings People,
Firstly I would like to thank everyone for your overwhelming response for my last 2 posts. I have received many feedbacks /Suggestions from many of my friends. So once again thank you So much for taking time to read and share feedback!
Many of the people suggested to include the errors /issues and some configuration and all.
Well, Topic for today I would like to share an issue. How to a SCSI disk to RHEL online (Without reboot). Recently my friend had experienced an issue he had added a SCSI disk in Linux however it is not visible in OS (fdisk –l).
How to troubleshoot this kind of situation how to make the disk visible in fdisk (OS) without rebooting.
My machine is running with “Red Hat Enterprise Linux Server release 6.3 (Santiago)”
I have 3 disks, 2 existing disks(2x10Gb) and one new 5GB disk to this machine added online.
Now run the fdisk –l | grep –i disk command to check whether the new disk detected or not.
It seems it is not detected .I can only see 2x10GBdisk in machine the new disk is not visible to the system.
Since it is not visible to the system you need to rescan the scsi bus to get the new disk.
Rescan can be issued using this command:
#echo "- - -" > /sys/class/scsi_host/host#/scan
Replace host# with actual value such as host0 or host 1 like this. You can find scsi_host value using the following command:
# ls /sys/class/scsi_host
Suppose if you have multiple scsi host values in the above command like what I have here.
Now you might be thinking how do I find the right scsi_hostvalue that you need to use with
echo "- - -" > /sys/class/scsi_host/host#/scan command.
The below 2 commands helps you to find which is the correct scsi_host value you need to use.
# grep mpt /sys/class/scsi_host/host?/proc_name
This command output help you to get the scsi_hostvalue. Here it is host2
Second option is to run the below command.
# udevadm info -a -p /sys/class/scsi_generic/sg0
The output of this command will be big however I am attaching the snippet of the portion that we need to look for scsi host value .
Once you have scsi_host value with you now you are ready for scanning the scsi bus.
[root@vinil ~]# echo "- - -" > /sys/class/scsi_host/host2/scan
( in my machine scsi_host value is host2)
Now just verify the /var/log/messages you could see some messages that the new disk is available in os
Similar to the below output:
Now you can run the fdisk –l |grep –i disk command to confirm that the new disk is available to OS.
I could see my new 5Gb (/dev/sdc) disk in the fdisknow.
Now you can create partition using fdisk/cfdisk or parted its upto you. J
NOTE: Same steps can be used in VMware workstation to add a new disk Linux VM . Give it a try.
Hope you enjoyed this topic! I would love to hear the feedback from you!
If this document is updated with the meanings for echo "- - -" that would have been better.
ReplyDeleteYou are amazing bro. I went through tons of webpages looking for this particular information, and i found it here. Thanks a lot
ReplyDeleteNow you might be thinking how do I find the right scsi_hostvalue that you need to use with
echo "- - -" > /sys/class/scsi_host/host#/scan command.