You can Watch all our Tutorials and Training Videos for Free on ourYouTube Channel

Add or Detect New Hard Disk Online Without Rebooting

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
As a system admin, We may come into a situation to Add a New Disk or Detect New Hard Disk Online to provide more space for the application installed.

How to detect new hard disk online without rebooting?

This post will help you with How to rescan or detect new hard disk online without rebooting the server.

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.

How to Rescan newly added Disk on Linux?

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 see a newly added disk on linux from fdisk command.

Related Content on Linux might be useful to you to improve your Linux Skills.


Keep practicing and have fun. Leave your comments if any.

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.
whatsapp logo