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.
If you are interested in learning, Request you to go through the below recommended tutorial.
DevOps Full Course Tutorial for Beginners - DevOps Free Training Online
Docker Full Course Tutorial for Beginners - Docker Free Training Online
Kubernetes Full Course Tutorial for Beginners - Kubernetes Free Training Online
Ansible Full Course Tutorial for Beginners - Ansible Free Training Online
Openstack Full Course Tutorial for Beginners - Openstack Free Training Online
Learn Linux, DevOps and Cloud
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
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.
How to Configure IP Address on Ubuntu using Netplan
How to Access Linux Server from Windows Remotely
Configure SSH Passwordless Login Authentication (SSH-keygen)
How to Create LVM Partition in Linux – LVM Tutorial
Install & Configure Samba Server on Linux (RHEL7 / CentOS7)
How to Access Linux Server from Windows Remotely
Configure SSH Passwordless Login Authentication (SSH-keygen)
How to Create LVM Partition in Linux – LVM Tutorial
Install & Configure Samba Server on Linux (RHEL7 / CentOS7)
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.
0 Comments