{"id":5847,"date":"2015-01-25T16:36:43","date_gmt":"2015-01-25T08:36:43","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=5847"},"modified":"2023-04-28T09:47:20","modified_gmt":"2023-04-28T09:47:20","slug":"how-to-add-a-new-hard-disk-without-rebooting-on-centos-7-rhel-7","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-add-a-new-hard-disk-without-rebooting-on-centos-7-rhel-7\/","title":{"rendered":"How to Add a New Hard Disk Without Rebooting on CentOS 7\/ RHEL 7"},"content":{"rendered":"<p>Normally when you have added new storage to a running Virtual machine, you probably won\u2019t see the new storage automatically.<\/p>\n<p>This is because the SCSI bus to which the storage devices are connected needs to be rescanned to make the new hardware visible.<\/p>\n<p>As a system administrator, to maintain the linux server uptime is very important and it is better to add a new hard disk without reboot the server.<\/p>\n<p>There is one simple command to rescan the SCSI Bus and add SCSI Devices. The command will trigger the linux rescan scsi bus device on the system.<\/p>\n<p>The following steps has been tested on CentOS 7, RHEL 7 and Oracle Linux 7.<\/p>\n<h2>Steps to Add a New Hard Disk Without Rebooting on CentOS 7\/ RHEL 7<\/h2>\n<p>1. Add the new 20GB vdisk from the ESXi or vCenter :<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5863 size-full lazyload\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/01\/Create-new-LVM-CentOS7-1.png\" alt=\"Add a New Hard Disk Without Reboot\" width=\"600\" height=\"533\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/01\/Create-new-LVM-CentOS7-1.png 600w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/01\/Create-new-LVM-CentOS7-1-300x267.png 300w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/533;\" \/><\/p>\n<p>2. Show current disk and partition :<\/p>\n<pre>[root@centos7 ~]# fdisk -l\n<\/pre>\n<pre>Disk \/dev\/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisk label type: dos\nDisk identifier: 0x0006b96a\n\n   Device Boot      Start         End      Blocks   Id  System\n\/dev\/sda1   *        2048     1026047      512000   83  Linux\n\/dev\/sda2         1026048    62914559    30944256   8e  Linux LVM\n\nDisk \/dev\/mapper\/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\n\n\nDisk \/dev\/mapper\/centos-root: 29.5 GB, 29536288768 bytes, 57688064 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\n<\/pre>\n<p>3. Identify host bus number :<\/p>\n<pre>[root@centos7 ~]# ls \/sys\/class\/scsi_host\/\nhost0  host1  host2\n<\/pre>\n<p>4. Rescan the SCSI Bus to Add a SCSI Devices :<\/p>\n<pre>[root@centos7 ~]# echo \"- - -\" &gt; \/sys\/class\/scsi_host\/host0\/scan\n[root@centos7 ~]# echo \"- - -\" &gt; \/sys\/class\/scsi_host\/host1\/scan\n[root@centos7 ~]# echo \"- - -\" &gt; \/sys\/class\/scsi_host\/host2\/scan\n<\/pre>\n<p>4. Verify the disk and partiton and make sure 20GB has been added. In this case, the following line appeared &#8220;Disk \/dev\/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors&#8221; and confirmed that 20GB has been added without reboot the server :<\/p>\n<pre>[root@centos7 ~]# fdisk -l\n\nDisk \/dev\/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisk label type: dos\nDisk identifier: 0x0006b96a\n\n   Device Boot      Start         End      Blocks   Id  System\n\/dev\/sda1   *        2048     1026047      512000   83  Linux\n\/dev\/sda2         1026048    62914559    30944256   8e  Linux LVM\n\nDisk \/dev\/mapper\/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\n\n\nDisk \/dev\/mapper\/centos-root: 29.5 GB, 29536288768 bytes, 57688064 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\n\n\n<strong>Disk \/dev\/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors\nUnits = sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<\/strong>\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Normally when you have added new storage to a running Virtual machine, you probably won\u2019t see the new storage automatically. This is because the SCSI bus to which the storage&#8230;<\/p>\n","protected":false},"author":6,"featured_media":6280,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1002],"tags":[1258,1556,1717],"class_list":["post-5847","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lvm","tag-centos-7","tag-lvm","tag-rhel-7"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/5847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=5847"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/5847\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/6280"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=5847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=5847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=5847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}