Disk is not getting detected after run the scsi command
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Disk is not getting detected after run the scsi command
Hi
RHEL 6.4 (64 Bit) is running as a Virutal Machine in a VCenter Server 5.5
As per our request, Vmware team added 500GB of disk space to this VM. Disk is not visible in "fdisk -l" after run the following command/script, but the new disk could be seen from the "multipath -l" command.
for i in `ls -ld /sys/class/scsi_host/host* | awk '{print $9}' `
do
echo "- - -" > $i/scan
done
Could someone clarify why it is not visible in "fdisk -l" output?
fdisk reads the list in /proc/partitions. If the disk doesn't show up there it won't be used. You can also check to see if there is a device in /dev/sd? that isn't already in use (if you only have one, it should be /dev/sda, a new one would be /dev/sdb. If /dev/sdb exists there but not in /proc/partitions, then try using partprobe to read any existing tables.
To get the partitions there requires the bus to be scanned (or the system rebooted). Partitions may be searched for using the partprobe, but I'm not sure it initiates a rescan of the SCSI bus for new devices (which is why rebooting is simpler).
Try using "partprobe" (no parameters - if the device exists in /dev, you can use partprobe /dev/sd? to load just that disk) to see if it adds the device.
Thanks for your reply. When checked, no relevant disks are found in /dev directory. Unfortunately, i didn't check the file /proc/partitions. Due to our environment design, i am not in the position to use partprobe command (we are partitioning into 8 slices and hiding the extended partitions before presenting to the application/database). All these things cornered me to reboot the server when fdisk/scsi scan failed to show up the newly added disk.
On a different note, i think partprobe will only re-read the partition table for the disks which is available/visible to the OS kernel where scsi scan will re-read the scsi bus to detect the newly added disks. Please correct me if am wrong.
Even this behaviour (not detecting the new disks) is odd as this is reflecting the disks sometimes and sometimes it is not. Hence got confused and decided to end up with this LQ thread to get it cleared.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.