Add or Detect a New Hard Disk Online Without Rebooting

linux detect new disk online, new disk in linux, linux rescan disk size, linux rescan disks online, adding new disk to linux, add new disk to linux

As a system admin, We may get a chance to add a vm disk or detect newly added disk physically for to provide more space.

It is possible to add or remove a SCSI device explicitly, or to re-scan an entire SCSI bus without rebooting a running Linux VM guest.

1. Ensure the required size is added newly online without shutting down or powered off in Hypervisors  such as vmware esx, vmware workstation and Microsoft Hyper-V before carrying out the Virtual Disk increasing activity.

2. Login into the server with user root or any other user with root privilege.

3. Run the below command to list the detected disk as below screenshot shows..

         [root@server1 ~]# fdisk -l

Add or Detect a New Hard Disk Online Without Rebooting
The above screenshot shows as our linux machine has only single disk of 10GB (/dev/sda).

4. Run the below command to list the entire SCSI device buses,

[root@server1 ~]# ll /sys/class/scsi_host/host?/scan
--w-------. 1 root root 4096 May 11 16:03 /sys/class/scsi_host/host0/scan
--w-------. 1 root root 4096 May 11 15:58 /sys/class/scsi_host/host1/scan
--w-------. 1 root root 4096 May 11 15:58 /sys/class/scsi_host/host2/scan



Above command listed the output of number of SCSI device buses, we have to run each below command for each SCSI device buses.

                         echo "- - -" > /sys/class/scsi_host/host0/scan 

Sample Commands for each SCSI Device Buses,

[root@server1 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@server1 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@server1 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan



Thats it, now you can find new disk using the fdisk command.

Hope let this helps someone, please share.
linux detect new disk online, new disk in linux, linux rescan disk size, linux rescan sata disks, adding new disk to linux, add new disk to linux, rescan disks linux redhat, linux rescan disk size, linux rescan disk geometry, linux rescan disk partitions, rescan disk linux redhat, linux rescan scsi disk size, linux rescan disks without reboot, linux rescan scsi devices
May 11, 2015

Post a Comment

[disqus][facebook][blogger]

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget