{"id":14028,"date":"2023-04-19T17:38:56","date_gmt":"2023-04-19T17:38:56","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=14028"},"modified":"2023-04-28T09:46:24","modified_gmt":"2023-04-28T09:46:24","slug":"how-to-add-new-disk-in-linux-centos-7-without-rebooting","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-add-new-disk-in-linux-centos-7-without-rebooting\/","title":{"rendered":"How to Add New Disk in Linux CentOS 7 Without Rebooting"},"content":{"rendered":"<p>In Linux CentOS 7, adding a new disk to a system does not require a system reboot. This is very useful in scenarios where the system has to stay up and running without interruption.<\/p>\n<p>There are several scenarios where this capability is extremely valuable. One of the most common reasons is to expand the storage capacity of a running system without any downtime. For example, in a production environment, it may not be feasible to take the system down to install a new disk, as it can result in significant financial losses due to service disruption.<\/p>\n<p>Another reason is to improve the performance of the system by separating the system&#8217;s data into different disks. By doing this, the system can reduce the I\/O wait time and increase the speed of data access.<\/p>\n<p>Moreover, adding a new disk without rebooting can also help in situations where there is a limited amount of space available on the existing disks, and there is a need to install additional software or store more data. In this scenario, adding a new disk can provide additional space and prevent the system from running out of disk space.<\/p>\n<p>Another use case is when migrating a virtual machine from one host to another. In this case, a new disk can be added to the virtual machine on the new host, and the data can be transferred to the new disk without any downtime.<\/p>\n<p>Finally, some users may want to add a new disk without rebooting for testing or learning purposes. It allows them to experiment with the system and its configuration without affecting its uptime or availability.<\/p>\n<p>In this step-by-step guide, we will explain how to add a new disk to Linux CentOS 7 without rebooting.<\/p>\n<h2>Step 1: Check the available disks on the system:<\/h2>\n<p>The first step is to identify the available disks on the system. We can use the &#8216;lsblk&#8217; command to list all the available disks on the system.<\/p>\n<pre>\r\n$ lsblk\r\n<\/pre>\n<h2>Step 2: Partition the new disk:<\/h2>\n<p>Next, we need to partition the new disk. We can use the &#8216;fdisk&#8217; command to create a new partition on the disk.<\/p>\n<pre>\r\n$ sudo fdisk \/dev\/sdb\r\n<\/pre>\n<p>This will open the fdisk utility. You can use the following commands to create a new partition:<\/p>\n<p>&#8211; Press &#8216;n&#8217; to create a new partition<br \/>\n&#8211; Select the partition type by pressing &#8216;p&#8217; for a primary partition, &#8216;e&#8217; for an extended partition, or &#8216;l&#8217; for a logical partition.<br \/>\n&#8211; Enter the partition number.<br \/>\n&#8211; Enter the starting and ending sector numbers. If you want to use the entire disk, you can press Enter for the default values.<br \/>\n&#8211; Press &#8216;w&#8217; to save the partition table.<\/p>\n<h2>Step 3: Format the new partition:<\/h2>\n<p>After partitioning the disk, we need to format the partition to a file system. In this example, we will format the partition to the ext4 file system.<\/p>\n<pre>\r\n$ sudo mkfs -t ext4 \/dev\/sdb1\r\n<\/pre>\n<h2>Step 4: Create a mount point:<\/h2>\n<p>Next, we need to create a mount point for the new partition. A mount point is a directory where the new partition will be attached to the file system.<\/p>\n<pre>\r\n$ sudo mkdir \/mnt\/newdisk\r\n<\/pre>\n<h2>Step 5: Mount the new partition:<\/h2>\n<p>Finally, we can mount the new partition to the mount point.<\/p>\n<pre>\r\n$ sudo mount \/dev\/sdb1 \/mnt\/newdisk\r\n<\/pre>\n<h2>Commands Mentioned:<\/h2>\n<ul>\n<li><span class=\"fw-bold\">lsblk<\/span> &#8211; List all available disks on the system.<\/li>\n<li><span class=\"fw-bold\">fdisk<\/span> &#8211; Create a new partition on the disk.<\/li>\n<li><span class=\"fw-bold\">mkfs<\/span> &#8211; Format the partition to a file system.<\/li>\n<li><span class=\"fw-bold\">mkdir<\/span> &#8211; Create a new directory.<\/li>\n<li><span class=\"fw-bold\">mount<\/span> &#8211; Mount a partition to a mount point.<\/li>\n<\/ul>\n<h2>Conclusion:<\/h2>\n<p>Adding a new disk to a Linux CentOS 7 system can be achieved without rebooting the system. By following these simple steps, you can partition, format, create a mount point, and mount the new disk to the file system. This guide can help you maintain the availability and uptime of your system while expanding its storage capacity.<\/p>\n<p>If you have any comments or suggestions for improvements, feel free to leave them below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Linux CentOS 7, adding a new disk to a system does not require a system reboot. This is very useful in scenarios where the system has to stay up&#8230;<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055],"tags":[1244,2015,2014,2016],"class_list":["post-14028","post","type-post","status-publish","format-standard","hentry","category-centos","tag-centos","tag-disk","tag-lsblk","tag-reboot"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/14028","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=14028"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/14028\/revisions"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=14028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=14028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=14028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}