{"id":11356,"date":"2019-03-13T06:54:01","date_gmt":"2019-03-13T06:54:01","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11356"},"modified":"2019-03-13T06:54:01","modified_gmt":"2019-03-13T06:54:01","slug":"how-to-add-a-new-disk-larger-than-2tb-to-an-existing-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/13\/how-to-add-a-new-disk-larger-than-2tb-to-an-existing-linux\/","title":{"rendered":"How to Add a New Disk Larger Than 2TB to An Existing Linux"},"content":{"rendered":"<p>Have you ever tried to do the partitioning of hard disk larger than\u00a0<strong>2TB<\/strong>\u00a0using\u00a0<a href=\"https:\/\/www.tecmint.com\/fdisk-commands-to-manage-linux-disk-partitions\/\" target=\"_blank\" rel=\"noopener\">fdisk utility<\/a>\u00a0and wondered why you end up getting a warning to use GPT? Yes, you got that right. We cannot partition a hard disk larger than 2TB using fdisk tool.<\/p>\n<p>In such cases, we can use\u00a0<strong>parted<\/strong>\u00a0command. The major difference lies in the partitioning formats that\u00a0<strong>fdisk<\/strong>uses\u00a0<strong>DOS<\/strong>\u00a0partitioning table format and\u00a0<strong>parted<\/strong>\u00a0uses\u00a0<strong>GPT<\/strong>\u00a0format.<\/p>\n<p><strong>TIP<\/strong>: You can use\u00a0<strong>gdisk<\/strong>\u00a0as well instead of\u00a0<strong>parted<\/strong>\u00a0tool.<\/p>\n<p>In this article, we will show you to add a new disk larger than\u00a0<strong>2TB<\/strong>\u00a0to an existing Linux server such as RHEL\/CentOS or Debian\/Ubuntu.<\/p>\n<p>I am using\u00a0<strong>fdisk<\/strong>\u00a0and\u00a0<strong>parted<\/strong>\u00a0utilities to do this configuration.<\/p>\n<p>First list the current partition details using fdisk command as shown.<\/p>\n<pre># fdisk -l\r\n<\/pre>\n<div id=\"attachment_25336\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/List-Linux-Partition-Table.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25336\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/List-Linux-Partition-Table.png\" alt=\"List Linux Partition Table\" width=\"658\" height=\"532\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">List Linux Partition Table<\/p>\n<\/div>\n<p>For the purpose of this article, I am attaching a hard disk of 20GB capacity, which can be followed for disk larger than\u00a0<strong>2TB<\/strong>\u00a0as well. Once you added a disk, verify the partition table using same fdisk command as shown.<\/p>\n<pre># fdisk -l\r\n<\/pre>\n<div id=\"attachment_25338\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/List-New-Partition-Table.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25338\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/List-New-Partition-Table.png\" alt=\"List New Partition Table\" width=\"618\" height=\"579\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">List New Partition Table<\/p>\n<\/div>\n<p><strong>Tip<\/strong>: If you are adding a physical hard disk, you may find that partitions already created. In such cases, you can use fdsik to delete the same before using parted.<\/p>\n<pre># fdisk \/dev\/xvdd\r\n<\/pre>\n<p>Use\u00a0<code>d<\/code>\u00a0switch for the command to delete the partition and\u00a0<code>w<\/code>\u00a0to write the changes and quit.<\/p>\n<div id=\"attachment_25340\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Delete-Linux-Partition.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25340\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Delete-Linux-Partition.png\" alt=\"Delete Linux Partition\" width=\"602\" height=\"282\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Delete Linux Partition<\/p>\n<\/div>\n<p><strong>Important<\/strong>: You need to be careful while deleting the partition. This will erase the data on the disk.<\/p>\n<p>Now its time to partition a new hard disk using parted command.<\/p>\n<pre># parted \/dev\/xvdd\r\n<\/pre>\n<p>Set the partition table format to GPT<\/p>\n<pre>(parted) mklabel gpt\r\n<\/pre>\n<p>Create the Primary partition and assign the disk capacity, here I am using 20GB (in your case it would be 2TB).<\/p>\n<pre>(parted) mkpart primary 0GB 20GB\r\n<\/pre>\n<div id=\"attachment_25343\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Create-Partition-using-Parted.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25343\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Create-Partition-using-Parted.png\" alt=\"Create Partition using Parted\" width=\"511\" height=\"165\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Create Partition using Parted<\/p>\n<\/div>\n<p>Just for curiosity, let\u2019s see how this new partition is listed in fdisk.<\/p>\n<pre># fdisk \/dev\/xvdd\r\n<\/pre>\n<div id=\"attachment_25347\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Verify-Partition-Details.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25347\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Verify-Partition-Details.png\" sizes=\"auto, (max-width: 930px) 100vw, 930px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Verify-Partition-Details.png 930w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Verify-Partition-Details-768x216.png 768w\" alt=\"Verify Partition Details\" width=\"930\" height=\"261\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Verify Partition Details<\/p>\n<\/div>\n<p>Now format and then mount the partition and add the same in\u00a0<strong>\/etc\/fstab<\/strong>\u00a0which controls the file systems to be mounted when the system boots.<\/p>\n<pre># mkfs.ext4 \/dev\/xvdd1\r\n<\/pre>\n<div id=\"attachment_25344\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Format-Linux-Partition.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25344\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/04\/Format-Linux-Partition.png\" alt=\"Format Linux Partition\" width=\"672\" height=\"367\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Format Linux Partition<\/p>\n<\/div>\n<p>Once partition has been formatted, now it\u2019s time mount the partition under\u00a0<strong>\/data1<\/strong>.<\/p>\n<pre># mount \/dev\/xvdd1 \/data1\r\n<\/pre>\n<p>For permanent mounting add the entry in\u00a0<strong>\/etc\/fstab<\/strong>\u00a0file.<\/p>\n<pre>\/dev\/xvdd1     \/data1      ext4      defaults  0   0\r\n<\/pre>\n<p><strong>Important<\/strong>: Kernel should support GPT in order to partition using GPT format. By default RHEL\/CentOS have Kernel with GPT support, but for Debian\/Ubuntu you need to recompile the kernel after changing the config.<\/p>\n<p>That\u2019s it! In this article, we have shown you how to use the parted command. Share your comments and feedback with us.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/add-disk-larger-than-2tb-to-an-existing-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever tried to do the partitioning of hard disk larger than\u00a02TB\u00a0using\u00a0fdisk utility\u00a0and wondered why you end up getting a warning to use GPT? Yes, you got that right. We cannot partition a hard disk larger than 2TB using fdisk tool. In such cases, we can use\u00a0parted\u00a0command. The major difference lies in the partitioning &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/13\/how-to-add-a-new-disk-larger-than-2tb-to-an-existing-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Add a New Disk Larger Than 2TB to An Existing Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11356","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11356"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11356\/revisions"}],"predecessor-version":[{"id":11357,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11356\/revisions\/11357"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}