Adding Storage to VM Host without Reboot

Information is increasing day by day, so we always require more space to save our data. And to save our digital data we need disk. In this article we will guide you and tell you how you can easily add new hard disk to your virtual server or host and properly scan new added storage hard disk without rebooting your virtual host.


Recommended Article: How to Configure Storage Device in Netbackup


Steps to add new Hard disk to Virtual Host


1. Right click on your host and go to its setting. You can also go from VM tab. Check below screenshot for reference.


vmware settings

2. Now select hard disk and click on Add as shown below.


Hard disk add vmware


3. Now add hard disk and select type as SCSI and choose desired disk capacity. For this example I am adding 200M disk. Also note down the virtual device node.


new hard disk to vm host


After adding new hard disk to our virtual server we need our kernel to detect it in order to use. In the live production environment we can’t reboot our system to take change effect. So in order to detect the new added hard disk in our system we need to scan or SCSI host.


Scanning new added hard disk without reboot


Before scanning your device you can use fdisk command to check if your newly added device is showing or not.

>fdisk -l

To make your work easy just use below script to scan all your host. This script will scan each and every SCSI host.

for x in `ls /sys/class/scsi_host/` ; do echo "-----$x Scanned-----"; echo "- - -" > /sys/class/scsi_host/$x/scan ; done

Below is the result of above script which clearly shows the scanning. The highlighted part shows the newly added hard disk.


newly added hard disk scanned


Now use fdisk command again to see newly added disk. You can also use dmesg command to check which device is added.

Now you can use this newly added device for any purpose. Add it to VG or share using NFS or use wherever you want, its up to you.

This is how you can easily scan new disk in your server without any reboot. Hope you find this article helpful. If you have any doubts leave your comments.

Buy me a coffeeBuy me a coffee

Add Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.