{"id":2249,"date":"2012-03-13T22:35:58","date_gmt":"2012-03-13T14:35:58","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2249"},"modified":"2023-06-24T06:55:01","modified_gmt":"2023-06-24T06:55:01","slug":"how-to-add-a-new-hard-disk-without-rebooting-vm-guest-on-rhel-6centos-6","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-add-a-new-hard-disk-without-rebooting-vm-guest-on-rhel-6centos-6\/","title":{"rendered":"How to Add a New Hard Disk Without Rebooting VM Guest on RHEL 6\/CentOS 6"},"content":{"rendered":"<p>In web server administration, there are instances where you might need to increase the storage capacity of your Linux RHEL 6 server. This could be due to a variety of reasons, such as the need for more space to store data or to improve the performance of your server. However, rebooting the server to add a new hard disk is not always feasible, especially in a production environment. <\/p>\n<p>This tutorial will guide you on how to add a new hard disk to your server without having to reboot it. This process is particularly applicable if your server is running on a VMware ESXi machine. The steps outlined here have been tested on Red Hat Enterprise Linux 6 (RHEL 6), but they may also work on RHEL 5 and CentOS 5.<\/p>\n<h2>Adding a New Hard Disk Without Rebooting<\/h2>\n<p>The first step in this process is to add a new disk to the VM Guest through VMware vCenter Server\/VMware vSphere. In this tutorial, we will be adding a 12 GB space to the second hard disk space, which is on the raw device \/dev\/sdb.<\/p>\n<p>Once you&#8217;ve added the new disk, the next step is to find the scsi_host value. This can be done using the following command:<\/p>\n<pre>\r\n[root@rhel6 ~]# ls \/sys\/class\/scsi_host\r\nhost0  host1  host2\r\n<\/pre>\n<p>In this RHEL 6 server, there are three scsi_host values: host0, host1, and host2.<\/p>\n<p>The third step is to rescan the SCSI Bus to add the SCSI Device without rebooting the VM. This can be done using the following commands:<\/p>\n<pre>\r\n[root@rhel6 host0]# echo \"- - -\" > \/sys\/class\/scsi_host\/host0\/scan\r\n[root@rhel6 host0]# echo \"- - -\" > \/sys\/class\/scsi_host\/host1\/scan\r\n[root@rhel6 host0]# echo \"- - -\" > \/sys\/class\/scsi_host\/host2\/scan\r\n<\/pre>\n<p>The final step is to check the new hard disk \/dev\/sdb. This can be done using the following command:<\/p>\n<pre>&lt;root@rhel6 ~&gt;# fdisk -l<\/pre>\n<p>After running this command, you should be able tosee the details of the new hard disk \/dev\/sdb, along with other disks on your server.<\/p>\n<p>Example:<\/p>\n<pre>\r\n[root@rhel6 ~]# fdisk -l\r\n\r\nDisk \/dev\/sda: 12.9 GB, 12884901888 bytes\r\n255 heads, 63 sectors\/track, 1566 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x0000690f\r\n\r\n   Device Boot      Start         End      Blocks   Id  System\r\n\/dev\/sda1   *           1          64      512000   83  Linux\r\nPartition 1 does not end on cylinder boundary.\r\n\/dev\/sda2              64        1567    12069888   8e  Linux LVM\r\n\r\nDisk \/dev\/dm-0: 10.2 GB, 10242490368 bytes\r\n255 heads, 63 sectors\/track, 1245 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00000000\r\n\r\nDisk \/dev\/dm-0 doesn't contain a valid partition table\r\n\r\nDisk \/dev\/dm-1: 2113 MB, 2113929216 bytes\r\n255 heads, 63 sectors\/track, 257 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00000000\r\n\r\nDisk \/dev\/dm-1 doesn't contain a valid partition table\r\n\r\nDisk \/dev\/sdb: 12.9 GB, 12884901888 bytes\r\n255 heads, 63 sectors\/track, 1566 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00000000\r\n\r\nDisk \/dev\/sdb doesn't contain a valid partition table\r\n<\/pre>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">ls \/sys\/class\/scsi_host<\/span> \u2013 This command is used to list the scsi_host values on your server.<\/li>\n<li><span class=\"fw-bold\">echo &#8220;- &#8211; -&#8221; &gt; \/sys\/class\/scsi_host\/hostX\/scan<\/span> \u2013 This command is used to rescan the SCSI Bus to add a SCSI Device without rebooting the VM. Replace &#8216;X&#8217; with the number of the host.<\/li>\n<li><span class=\"fw-bold\">fdisk -l<\/span> \u2013 This command is used to list the details of the disks on your server.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Adding a new hard disk to your Linux RHEL 6 server without having to reboot it is a valuable skill for any web server administrator. It allows you to increase your server&#8217;s storage capacity without causing any downtime, which is crucial in a production environment. By following the steps outlined in this tutorial, you can easily add a new hard disk to your server.<\/p>\n<p>Remember, the type of hosting you choose, be it a <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated<\/a>, or <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS<\/a> server, can also influence how you manage your server. Therefore, always ensure to choose the hosting type that best suits your needs.<\/p>\n<p>With the knowledge gained from this tutorial, you are now better equipped to manage your server effectively and efficiently. Keep exploring and learning, and you&#8217;ll become a web server administration expert in no time.<\/p>\n<h2>FAQs<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the purpose of adding a new hard disk without rebooting?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Adding a new hard disk without rebooting is essential in a production environment where downtime can lead to significant losses. It allows for increased storage space without disrupting the server&#8217;s operations.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What does the command &#8216;ls \/sys\/class\/scsi_host&#8217; do?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The command &#8216;ls \/sys\/class\/scsi_host&#8217; is used to list the scsi_host values on your server. These values are essential when rescanning the SCSI Bus to add a SCSI Device.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What does the command &#8216;fdisk -l&#8217; do?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The command &#8216;fdisk -l&#8217; is used to list the details of the disks on your server. It&#8217;s useful for verifying the addition of the new hard disk.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Can this process be used on other Linux distributions?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">This process has been tested on Red Hat Enterprise Linux 6 (RHEL 6). It may also work on RHEL 5 and CentOS 5, but it&#8217;s always recommended to refer to the specific documentation of your Linux distribution.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the significance of the VMware ESXi machine in this process?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The VMware ESXi machine is the virtualization server in this context. It&#8217;s where the VM Guest, to which the new hard disk is being added, is hosted.<\/span>\n            <\/p>\n<p><\/<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In web server administration, there are instances where you might need to increase the storage capacity of your Linux RHEL 6 server. This could be due to a variety of&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1499,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,2058],"tags":[1409,1536,1713,1715,1895,1899],"class_list":["post-2249","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-rhel","tag-hard-disk","tag-linux","tag-rhel","tag-rhel-6","tag-vmware","tag-vmware-vsphere"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2249","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=2249"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2249\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1499"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}