{"id":670,"date":"2020-02-23T08:38:55","date_gmt":"2020-02-23T07:38:55","guid":{"rendered":"https:\/\/codedoneright.eu\/?page_id=670"},"modified":"2020-05-11T22:13:35","modified_gmt":"2020-05-11T21:13:35","slug":"partition-and-format-in-cli","status":"publish","type":"page","link":"https:\/\/codedoneright.eu\/?page_id=670","title":{"rendered":"Partition and format in CLI"},"content":{"rendered":"\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Once you realize that some services would be much more useful with some external storage, it is time to plug in a disk into your Pi, but you need to partition and format it properly before usage.<\/p>\n\n\n\n<p><strong>CAUTION<\/strong> Remember that partitioning and formatting will lead to data loss! Before you start, back-up any data on the drive!<\/p>\n\n\n\n<p><strong>CAUTION<\/strong> It is best to practice on a device without any data, at the end of the tutorial you will find an example of how to partition and format an SD card.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">A word on partitions<\/h2>\n\n\n\n<p>First, you need to think about is the number of partitions that you will use. There is no universal solution, you just have to think about the intended use of the drive. You may want to store all data on one partition, but in separate folders, or make a separate partition for each service.<\/p>\n\n\n\n<p>I prefer having one partition with multiple folders, as it helps to scale. Imagine that you set up two equal partitions on a 500GB drive, one for your website and one for a local samba share. It is unlikely that your website will use 250GB, on the other hand, a samba share for video and music might need more than 250MB. In such a setup  you will be left with one partition too small and one too large. But the choice is yours.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Checking available storage<\/h3>\n\n\n\n<p><strong>CAUTION<\/strong> you might need to boot your Raspberry with the drive plugged in, or reboot after plugging it in, otherwise the device might not get recognized. Such a flaw may present itself while using an unpowered case. Alternatively your SSH session might freeze<\/p>\n\n\n\n<p>Plug your disk into your server and check if the device is being recognized with the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo fdisk -l<\/code><\/pre>\n\n\n\n<p>At the bottom of a quite lengthy output you should see an entry similar to the following<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"161\" src=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png\" alt=\"\" class=\"wp-image-598\" srcset=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png 512w, https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk-300x94.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/figure><\/div>\n\n\n\n<p>Entry <em>Disk \/dev\/sda<\/em> shows the disk itself, the physical device. Partitions of that disk will be listed as <em>\/dev\/sdaX<\/em> where <em>X<\/em> is the number of a partition.<\/p>\n\n\n\n<p>If you have only one partition on a given disk, you will see just <em>\/dev\/sda1<\/em>, like on the screenshot above.<\/p>\n\n\n\n<p>If you have more drives, the second will be shown as <em>\/dev\/sdb<\/em> with partitions starting from <em>\/dev\/sdb1<\/em>, third drive will be <em>\/dev\/sdc<\/em> etc.<\/p>\n\n\n\n<p><em>fdisk<\/em> <em>-l<\/em> shows an overview of drives available to you, and will allow to identify partitions belonging to a particular drive. For convenience, partitions on a given drive are listed together.<\/p>\n\n\n\n<p>In case you have trouble identifying disks you can google the <em>Disk model<\/em> to make sure which <em>\/dev\/sdX<\/em> is which disk. But you should be able to figure that on your own.<\/p>\n\n\n\n<p><strong>CAUTION<\/strong> pendrives and SD cards might be shown as <em>Disk model: STORAGE DEVICE<\/em>. You have to orient yourself by the size of your device in such a case.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Unmounting drives<\/h2>\n\n\n\n<p>If you want to make changes to drives that are already mounted, then you have to unmount them first. You cannot make any changes while the drive is in use!<\/p>\n\n\n\n<p>Learn about mounting and unmounting drives in <a href=\"https:\/\/codedoneright.eu\/?page_id=620\">this tutorial<\/a><\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Partitioning a drive<\/h2>\n\n\n\n<p>Once you identified the disk you want to change, run the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo fdisk \/dev\/sdX<\/code><\/pre>\n\n\n\n<p>Replace X at the end of the command with the letter of the drive you want to change. You will see the following<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"545\" height=\"134\" src=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk_dev.png\" alt=\"\" class=\"wp-image-674\" srcset=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk_dev.png 545w, https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk_dev-300x74.png 300w\" sizes=\"(max-width: 545px) 100vw, 545px\" \/><\/figure><\/div>\n\n\n\n<p>Now you are modifying your storage device. Type m for the list of available commands.<\/p>\n\n\n\n<p>Most useful commands (case sensitive) are<\/p>\n\n\n\n<ul><li>d \u2013 delete a partition<\/li><li>F \u2013 list free and unallocated space<\/li><li>n \u2013 add a new partition<\/li><li>w \u2013 write changes to disk and exit<\/li><li>q \u2013 ignore changes and exit without saving (at any stage)<\/li><\/ul>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Deleting partitions<\/h2>\n\n\n\n<p>While in <em>fdisk<\/em> menu, delete a partition with the following<\/p>\n\n\n\n<p>Type <em><strong>d<\/strong><\/em> and press <em>Enter<\/em> <\/p>\n\n\n\n<p>If you have only one partition, it will be selected and deleted automatically. With more partitions you will be asked which partition to delete. Partition <em>1<\/em> will be the <em>\/dev\/sdX1<\/em>, partition <em>2<\/em> will be the <em>\/dev\/sdX2<\/em> etc.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Adding partitions<\/h2>\n\n\n\n<p>While in fdisk menu, add a partition with the following<\/p>\n\n\n\n<p>Type <em><strong>n<\/strong><\/em> and press <em>Enter<\/em><\/p>\n\n\n\n<p>You will be asked a series of questions about the new partition. If you press <em>ENTER<\/em> without any input, then <em>fdisk<\/em> will use the default setting.<\/p>\n\n\n\n<ul><li><strong>Partition type<\/strong> \u2013 since you are preparing disk just for additional storage, use the default value <em><strong>p<\/strong><\/em> (primary)<\/li><li><strong>Partition number<\/strong> \u2013 it is best to create partitions with consecutive numbers, start with the default value <strong><em>1<\/em><\/strong><\/li><li><strong>First sector<\/strong> \u2013  use the default value since you want to use all available space<\/li><li><strong>Last sector<\/strong> \u2013 if you want the partition to take up the whole disk, use the default value<ul><li>If you want to create more then one partition \u2013 when specifying &#8216;end&#8217; of the partition<ul><li>You can specify sectors just by typing the sector number itself e.g. <em>5048<\/em><\/li><li>Or you can specify size in M\/GB e.g. <em>+16G<\/em> (note the <em>+<\/em> before number!)<\/li><\/ul><\/li><\/ul><\/li><li><strong>Remove signature<\/strong> \u2013 as we will be formatting the drive anyways just say <strong><em>Y<\/em><\/strong><\/li><\/ul>\n\n\n\n<p>If you want to create more than one partition, see the SD card example below. It is easier to guide you through it.<\/p>\n\n\n\n<p>After you are done adding partitions, type <strong><em>i<\/em><\/strong> to see changes and make sure it is correct. <\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Writing changes to the drive<\/h2>\n\n\n\n<p>Now that you partitioned the device, it is time to write changes<\/p>\n\n\n\n<p>Type <strong><em>w<\/em><\/strong> to save and exit<\/p>\n\n\n\n<p>System will tell you that all changes have been saved and partition table reloaded. Confirm by using <em>fdisk<\/em> to list all devices with <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo fdisk -l<\/code><\/pre>\n\n\n\n<p>Look for the <em>\/dev\/sdX<\/em> drive you were modifying in the output and confirm changes.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Initializing a brand new disk<\/h2>\n\n\n\n<p>Brand new, store-bought disks need one more step before you can use them. You have to <em>Create a new label<\/em> first. Which is a partition table.<\/p>\n\n\n\n<p>While in <em>fdisk<\/em>, <strong>before<\/strong> making a new partition, type <strong>g<\/strong> for a new GTP table or <strong>o<\/strong> for a new DOS table. You can read more about table types in <a href=\"https:\/\/en.wikipedia.org\/wiki\/GUID_Partition_Table\">this Wikipedia article<\/a>. If unsure, just go with GPT.<\/p>\n\n\n\n<p>Upon deciding on a partition table type, you can go ahead and create new partitions.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">SD card with multiple partitions example<\/h2>\n\n\n\n<p>All storage devices are devided into sectors.  If you want to create equal partitions use them for expressing capacity instead of gigabytes. My 32GB SanDisk has the usable sector range from 2048 to 62,333,951. <\/p>\n\n\n\n<p>If I wanted to make two equal partitions sector division would look like so<\/p>\n\n\n\n<ul><li>Partition 1 \u2013 2048 to 31,166,975<\/li><li>Partition 2 \u2013 31,166,976 to 62,333,951<\/li><\/ul>\n\n\n\n<p>Three equal partitions would look like so<\/p>\n\n\n\n<ul><li>Partition 1 \u2013 2048 to 20,777,983<\/li><li>Partition 2 \u2013 20,777,984 to 41,555,968<\/li><li>Partition 3 \u2013 41,555,968 to 62,333,951<\/li><\/ul>\n\n\n\n<p>However, if I were to use GB instead, the logical conclusion would be to divide the card in two 16GB partitions, right? Not exactly. Due to a difference between how manufacturers describe capacity and the actual capacity of the card, if I would set up the first partition to have 16GB I would be left with the following<\/p>\n\n\n\n<ul><li>Partition 1 \u2013 16.0GB<\/li><li>Partition 2 \u2013 13.7GB<\/li><\/ul>\n\n\n\n<p>This is because manufacturers describe 1GB as 1,000MB while in reality 1GB equals to 1,024MB. That is why a 32GB SD has only 29.7GB and we &#8216;loose&#8217; storage. No drive will have the capacity declared by the manufacturer, ever.<\/p>\n\n\n\n<p><strong>NOTE <\/strong>in the above example commas are just for readability. Do not type commas while partitioning your drive!<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Formatting partitions<\/h2>\n\n\n\n<p>Before using a partition you have to format it first.<\/p>\n\n\n\n<p>Formatting partitions is really easy, just make sure you are specifying the correct one as you will lose ALL data contained on the partition.<\/p>\n\n\n\n<p>Formatting is done via <em>mkfs<\/em> command. Take a look at its syntax<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkfs.TYPE \/dev\/sdX#<\/code><\/pre>\n\n\n\n<ul><li><strong>TYPE<\/strong> \u2013 specifies the filesystem that your partition will be formatted to<\/li><li><strong>X<\/strong> \u2013 specifies the drive letter<\/li><li><strong>#<\/strong> \u2013 specifies the partition number<\/li><\/ul>\n\n\n\n<p>Default TYPE of filesystem of RaspbianOS is <em>ext2<\/em>, use it only if you want to format an SD card. <strong>If you are formatting a hard drive, use <em>ext4<\/em> instead<\/strong>. You can read why in <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ext4\">this Wikipedia article<\/a> and a quick rundown is available on <a href=\"https:\/\/kerneltalks.com\/disk-management\/difference-between-ext2-ext3-and-ext4\/\">kerneltalks.com here<\/a>.<\/p>\n\n\n\n<p>If you want to check all available file systems, to which you can format a partition, type <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkfs.<\/code><\/pre>\n\n\n\n<p>And press <em>TAB<\/em> twice, system will print all available commands starting with <em>mkfs.<\/em> Each variation of <em>mkfs<\/em> command formats a partition to a specific file system. They are all separate commands, following the Linux spirit of &#8220;one program should do one thing, but well&#8221;.<\/p>\n\n\n\n<p><strong>CAUTION<\/strong> depending on the file system you have chosen and partition capacity, the operation might take five seconds, five minutes or an hour. Do not unplug power during this procedure. <em>ext4<\/em> format should be quick though.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Example<\/h5>\n\n\n\n<p>Let us assume you want to format the first partition of the only drive attached to your Raspberry Pi to <em>ext4<\/em> filesystem, the syntax would look like this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkfs.ext4 \/dev\/sda1<\/code><\/pre>\n\n\n\n<p>After a brief moment, and a few prompts, your partition will be formatted. <\/p>\n\n\n\n<p><strong>CAUTION <\/strong>remember that you WILL lose all your data! Be sure to specify the correct partition!<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Live partitioning and formatting example<\/h2>\n\n\n\n<p>Below screenshots show steps of partitioning an SD card visible as <em>\/dev\/sda<\/em> that currently has two <em>ext4<\/em> partitions (<em>\/dev\/sda1<\/em> and <em>\/dev\/sda2<\/em>). I will remove them, create one new partition and format it to <em>ext4<\/em>. <\/p>\n\n\n\n<p>Note that I am using default values by not specifying any parameters, as explained above.<\/p>\n\n\n\n<p><strong>Removing partitions and creating a new one<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"661\" height=\"648\" src=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk_part.png\" alt=\"\" class=\"wp-image-683\" srcset=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk_part.png 661w, https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk_part-300x294.png 300w\" sizes=\"(max-width: 661px) 100vw, 661px\" \/><\/figure>\n\n\n\n<p><strong>Formatting the newly created partition to FAT and then to ext4<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"290\" src=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/mkfs_fat.png\" alt=\"\" class=\"wp-image-686\" srcset=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/mkfs_fat.png 666w, https:\/\/codedoneright.eu\/wp-content\/uploads\/mkfs_fat-300x131.png 300w\" sizes=\"(max-width: 666px) 100vw, 666px\" \/><\/figure><\/div>\n\n\n\n<p>I formatted the partition to FAT firstly, just to show that different file systems have different formatting process.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors<\/h2>\n\n\n\n<h6 class=\"wp-block-heading\">Partition 1 does not start on physical sector boundary<\/h6>\n\n\n\n<p>If after creating a partition you encounter the following error after running <em>fdisk -l<\/em> command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Partition 1 does not start on physical sector boundary<\/code><\/pre>\n\n\n\n<p>it means that you have to fix the starting sector of that partition. <\/p>\n\n\n\n<p>Long story short, partitions should start on sectors that can be devided by 8. If your start sector is 65535 then, instead of using the default value, just add 1 so that it starts on 65536.<\/p>\n\n\n\n<p>If you do not fix this then your disk might be prone to write errors.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Lazy initialization<\/h6>\n\n\n\n<p>This one is not an error, but can be viewed as one by an inexperienced user.<\/p>\n\n\n\n<p>After formatting a drive to <em>ext4<\/em>, you will notice that system is writing to disk periodically. This is normal and easily observable on an HDD when you hear the disk writing data.<\/p>\n\n\n\n<p>In order to speed up the formatting process, disk inodes are not cleaned during the format. It is done afterwards so that the disk can be used right away. <\/p>\n\n\n\n<p>Give the drive some time and do not power down your server. Just wait for it to finish. HDD drives will not go to sleep, nor will they spin down until the process is completed. The bigger the drive, the longer you will have to wait.<\/p>\n\n\n\n<p>During lazy initialization the disk if fully usable.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Partitioning and formatting is quite easy, however, you have to be mindful of disks you are modifying. It is easy to mistake <em>\/dev\/sda1<\/em> for <em>\/dev\/sda2<\/em> and format the wrong partition. Double check any command you are issuing as there is no turning back once you commit by pressing ENTER.<\/p>\n\n\n\n<p>I had to reinstall my laptop once since instead of writing to <em>\/dev\/sdb<\/em> I typed <em>\/dev\/sda<\/em> effectively formatting my boot drive. Be cautious, Linux assumes you know what you are doing. Even if you do not.<\/p>\n\n\n\n<p>Is something unclear or you would like me to expand on a particular aspect? Leave a comment below!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once you realize that some services would be much more useful with some external storage, it is time to plug in a disk into your Pi, but you need to partition and format it properly before usage. CAUTION Remember that&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1026,"menu_order":25,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Partition and format your drives in CLI &#8212; Code Done Right!<\/title>\n<meta name=\"description\" content=\"Learn how to partition and format your storage devices in Command Line Interface \u2013 directly on your Rapsberry Pi server, without the need of a PC!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codedoneright.eu\/?page_id=670\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Partition and format your drives in CLI &#8212; Code Done Right!\" \/>\n<meta name=\"twitter:description\" content=\"Learn how to partition and format your storage devices in Command Line Interface \u2013 directly on your Rapsberry Pi server, without the need of a PC!\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codedoneright.eu\/?page_id=670\",\"url\":\"https:\/\/codedoneright.eu\/?page_id=670\",\"name\":\"Partition and format your drives in CLI &#8212; Code Done Right!\",\"isPartOf\":{\"@id\":\"https:\/\/codedoneright.eu\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codedoneright.eu\/?page_id=670#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codedoneright.eu\/?page_id=670#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png\",\"datePublished\":\"2020-02-23T07:38:55+00:00\",\"dateModified\":\"2020-05-11T21:13:35+00:00\",\"description\":\"Learn how to partition and format your storage devices in Command Line Interface \u2013 directly on your Rapsberry Pi server, without the need of a PC!\",\"breadcrumb\":{\"@id\":\"https:\/\/codedoneright.eu\/?page_id=670#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codedoneright.eu\/?page_id=670\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codedoneright.eu\/?page_id=670#primaryimage\",\"url\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png\",\"contentUrl\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png\",\"width\":512,\"height\":161},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codedoneright.eu\/?page_id=670#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codedoneright.eu\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\/\/codedoneright.eu\/?page_id=1026\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Partition and format in CLI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codedoneright.eu\/#website\",\"url\":\"https:\/\/codedoneright.eu\/\",\"name\":\"Code Done Right!\",\"description\":\"Raspberry Pi server guides\",\"publisher\":{\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codedoneright.eu\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568\",\"name\":\"CodeDoneRight\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png\",\"contentUrl\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png\",\"width\":120,\"height\":120,\"caption\":\"CodeDoneRight\"},\"logo\":{\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/codedoneright.eu\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Partition and format your drives in CLI &#8212; Code Done Right!","description":"Learn how to partition and format your storage devices in Command Line Interface \u2013 directly on your Rapsberry Pi server, without the need of a PC!","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:\/\/codedoneright.eu\/?page_id=670","twitter_card":"summary_large_image","twitter_title":"Partition and format your drives in CLI &#8212; Code Done Right!","twitter_description":"Learn how to partition and format your storage devices in Command Line Interface \u2013 directly on your Rapsberry Pi server, without the need of a PC!","twitter_image":"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png","twitter_misc":{"Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/codedoneright.eu\/?page_id=670","url":"https:\/\/codedoneright.eu\/?page_id=670","name":"Partition and format your drives in CLI &#8212; Code Done Right!","isPartOf":{"@id":"https:\/\/codedoneright.eu\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codedoneright.eu\/?page_id=670#primaryimage"},"image":{"@id":"https:\/\/codedoneright.eu\/?page_id=670#primaryimage"},"thumbnailUrl":"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png","datePublished":"2020-02-23T07:38:55+00:00","dateModified":"2020-05-11T21:13:35+00:00","description":"Learn how to partition and format your storage devices in Command Line Interface \u2013 directly on your Rapsberry Pi server, without the need of a PC!","breadcrumb":{"@id":"https:\/\/codedoneright.eu\/?page_id=670#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codedoneright.eu\/?page_id=670"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codedoneright.eu\/?page_id=670#primaryimage","url":"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png","contentUrl":"https:\/\/codedoneright.eu\/wp-content\/uploads\/fdisk.png","width":512,"height":161},{"@type":"BreadcrumbList","@id":"https:\/\/codedoneright.eu\/?page_id=670#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codedoneright.eu\/"},{"@type":"ListItem","position":2,"name":"Linux","item":"https:\/\/codedoneright.eu\/?page_id=1026"},{"@type":"ListItem","position":3,"name":"Partition and format in CLI"}]},{"@type":"WebSite","@id":"https:\/\/codedoneright.eu\/#website","url":"https:\/\/codedoneright.eu\/","name":"Code Done Right!","description":"Raspberry Pi server guides","publisher":{"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codedoneright.eu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568","name":"CodeDoneRight","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/","url":"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png","contentUrl":"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png","width":120,"height":120,"caption":"CodeDoneRight"},"logo":{"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/codedoneright.eu"]}]}},"_links":{"self":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/670"}],"collection":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=670"}],"version-history":[{"count":27,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/670\/revisions"}],"predecessor-version":[{"id":976,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/670\/revisions\/976"}],"up":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/1026"}],"wp:attachment":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}