{"id":415,"date":"2020-05-10T02:55:00","date_gmt":"2020-05-09T21:25:00","guid":{"rendered":"https:\/\/tools.discussdigital.online\/?p=415"},"modified":"2023-01-28T12:49:34","modified_gmt":"2023-01-28T07:19:34","slug":"how-to-partition-and-format-storage-devices-in-linux","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/","title":{"rendered":"How To Create Partition and Format Storage Devices in Linux"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"partition-the-new-drive\">Partition the New Drive<\/h2>\n\n\n\n<p>As mentioned in the introduction, we&#8217;ll create a single partition spanning the entire disk in this guide.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"choose-a-partitioning-standard\">Choose a Partitioning Standard<\/h3>\n\n\n\n<p>To do this, we first need to specify the partitioning standard we wish to use.  GPT is the more modern partitioning standard, while the  MBR standard offers wider support among operating systems.  If you do not have any special requirements, it is probably better to use GPT at this point.<\/p>\n\n\n\n<p>To choose the <strong>GPT<\/strong> standard, pass in the disk you identified like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo parted \/dev\/sda mklabel gpt\n<\/pre>\n\n\n\n<p>If you wish to use the <strong>MBR<\/strong> format, type this instead:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo parted \/dev\/sda mklabel msdos\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-the-new-partition\">Create the New Partition<\/h3>\n\n\n\n<p>Once the format is selected, you can create a partition spanning the entire drive by typing:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo parted -a opt \/dev\/sda mkpart primary ext4 0% 100%\n<\/pre>\n\n\n\n<p>If we check <code>lsblk<\/code>, we should see the new partition available:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">lsblk\n<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>OutputNAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT\nsda      8:0    0   100G  0 disk \n\u2514\u2500sda1   8:1    0   100G  0 part \nvda    253:0    0    20G  0 disk \n\u2514\u2500vda1 253:1    0    20G  0 part \/\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-a-filesystem-on-the-new-partition\">Create a Filesystem on the New Partition<\/h2>\n\n\n\n<p>Now that we have a partition available, we can format it as an Ext4 filesystem.  To do this, pass the partition to the <code>mkfs.ext4<\/code> utility.<\/p>\n\n\n\n<p>We can add a partition label by passing the <code>-L<\/code> flag.  Select a name that will help you identify this particular drive:\n\nnote\nMake sure you pass in the <strong>partition<\/strong> and not the entire <strong>disk<\/strong>.  In Linux, disks have names like <code>sda<\/code>, <code>sdb<\/code>, <code>hda<\/code>, etc.  The partitions on these disks have a number appended to the end.  So we would want to use something like <code>sda1<\/code> and <strong>not<\/strong><code>sda<\/code>.<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mkfs.ext4 -L datapartition \/dev\/sda1\n<\/pre>\n\n\n\n<p>If you want to change the partition label at a later date, you can use the <code>e2label<\/code> command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo e2label \/dev\/sda1 newlabel\n<\/pre>\n\n\n\n<p>You can see all of the different ways to identify your partition with <code>lsblk<\/code>.  We want to find the name, label, and UUID of the partition.<\/p>\n\n\n\n<p>Some versions of <code>lsblk<\/code> will print all of this information if we type:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo lsblk --fs\n<\/pre>\n\n\n\n<p>If your version does not show all of the appropriate fields, you can request them manually:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo lsblk -o NAME,FSTYPE,LABEL,UUID,MOUNTPOINT\n<\/pre>\n\n\n\n<p>You should see something like this.  The highlighted output indicate \ndifferent methods you can use to refer to the new filesystem:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>OutputNAME   FSTYPE LABEL         UUID                                 MOUNTPOINT\nsda                                                              \n\u2514\u2500sda1 ext4   datapartition 4b313333-a7b5-48c1-a957-d77d637e4fda \nvda                                                              \n\u2514\u2500vda1 ext4   DOROOT        050e1e34-39e6-4072-a03e-ae0bf90ba13a \/\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Partition the New Drive As mentioned in the introduction, we&#8217;ll create a single partition spanning the entire disk in this guide. Choose a Partitioning Standard To do this, we first need to specify the partitioning standard we wish to use. GPT is the more modern partitioning standard, while the MBR standard offers wider support among [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3608,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[34,1],"tags":[],"class_list":["post-415","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-uncategorized"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Create Partition and Format Storage Devices in Linux | 24x7serversupport Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Create Partition and Format Storage Devices in Linux | 24x7serversupport Blog\" \/>\n<meta property=\"og:description\" content=\"Partition the New Drive As mentioned in the introduction, we&#8217;ll create a single partition spanning the entire disk in this guide. Choose a Partitioning Standard To do this, we first need to specify the partitioning standard we wish to use. GPT is the more modern partitioning standard, while the MBR standard offers wider support among [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-09T21:25:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-28T07:19:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/\",\"name\":\"How To Create Partition and Format Storage Devices in Linux | 24x7serversupport Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png?fit=800%2C422&ssl=1\",\"datePublished\":\"2020-05-09T21:25:00+00:00\",\"dateModified\":\"2023-01-28T07:19:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png?fit=800%2C422&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png?fit=800%2C422&ssl=1\",\"width\":800,\"height\":422,\"caption\":\"How To Create Partition and Format Storage Devices in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Create Partition and Format Storage Devices in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Create Partition and Format Storage Devices in Linux | 24x7serversupport Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How To Create Partition and Format Storage Devices in Linux | 24x7serversupport Blog","og_description":"Partition the New Drive As mentioned in the introduction, we&#8217;ll create a single partition spanning the entire disk in this guide. Choose a Partitioning Standard To do this, we first need to specify the partitioning standard we wish to use. GPT is the more modern partitioning standard, while the MBR standard offers wider support among [&hellip;]","og_url":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/","og_site_name":"24x7serversupport Blog","article_published_time":"2020-05-09T21:25:00+00:00","article_modified_time":"2023-01-28T07:19:34+00:00","og_image":[{"width":800,"height":422,"url":"https:\/\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png","type":"image\/png"}],"author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/","url":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/","name":"How To Create Partition and Format Storage Devices in Linux | 24x7serversupport Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png?fit=800%2C422&ssl=1","datePublished":"2020-05-09T21:25:00+00:00","dateModified":"2023-01-28T07:19:34+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#primaryimage","url":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png?fit=800%2C422&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png?fit=800%2C422&ssl=1","width":800,"height":422,"caption":"How To Create Partition and Format Storage Devices in Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-partition-and-format-storage-devices-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Create Partition and Format Storage Devices in Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/05\/How-To-Create-Partition-and-Format-Storage-Devices-in-Linux-.png?fit=800%2C422&ssl=1","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=415"}],"version-history":[{"count":2,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/415\/revisions"}],"predecessor-version":[{"id":3118,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/415\/revisions\/3118"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media\/3608"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}