{"id":2163,"date":"2015-07-02T14:35:19","date_gmt":"2015-07-02T14:35:19","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=2163"},"modified":"2019-01-24T16:00:57","modified_gmt":"2019-01-24T16:00:57","slug":"resizing-partitions-disks","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/pi-operating-systems\/resizing-partitions-disks","title":{"rendered":"Resizing Partitions &#038; Disks"},"content":{"rendered":"<p>You may want to resize your partition to solve an issue with Win32 Disk Imager not being able to write to a new card due to it being slightly too small, or to change\u00a0to a smaller SD card.<\/p>\n<p>Here&#8217;s what we want to do:<\/p>\n<p style=\"margin-left: 40px;\">Resize the linux\u00a0partition on the SD card to fit within the new space requirement, leaving an unused area after it<\/p>\n<p style=\"margin-left: 40px;\">Resize the file\u00a0system on that\u00a0partition once its been changed.<\/p>\n<p style=\"margin-left: 40px;\">Resize the .img file<\/p>\n<h5>Resize The Partition<\/h5>\n<p>First you need to reduce the size of the linux\u00a0partition. \u00a0DO THIS\u00a0<a href=\"https:\/\/raspberry-projects.com\/pi\/software_utilities\/disk-tools\/gparted\">FOLLOWING THE GUIDE HERE<\/a>\u00a0(if your issue is with\u00a0Win32 Disk Imager then you may have to find a SD card the existing .iso can be written onto to do this, even if this means\u00a0needing\u00a0to use\u00a0the next card\u00a0capacity up from the size you want to use.<\/p>\n<p>Once the resize is complete you need to find out the total final size of the used space on the\u00a0card (the FAT16 boot partition the RPi needs and the ext 4 partition that holds Linux, basically all the partitions before the unused area at the end of the card you&#8217;ve just created.<\/p>\n<p>Now with the SD card booted up use the following commands to find the size of the area thats used:<\/p>\n<p>sudo fdisk \/dev\/mmcblk0<\/p>\n<p>Press &#8216;p&#8217; then return to see the partitions.<\/p>\n<p>For example you will get something like this:<\/p>\n<pre><code>\nDevice         Boot  Start      End  Sectors  Size Id Type\n\n\/dev\/mmcblk0p1        8192   122879   114688   56M  c W95 FAT32 (LBA)\n\n\/dev\/mmcblk0p2      122880 12410879 12288000  5.9G 83 Linux\n<\/code><\/pre>\n<p>Get the End sector value for the last partition (12410879). Multiple by 512 (bytes per sector) to give you the target .iso file size (6,354,370,048 bytes) and make a note of this value (make sure you haven&#8217;t made a\u00a0mistake!)<\/p>\n<p>Press &#8216;q&#8217; then return to quit.<\/p>\n<p>In this example we&#8217;ll say we want our new card image to be 15400000 sectors (x 512 bytes per sector = 7,884,800,000 bytes)<\/p>\n<h5>Create a new .iso with the resized partition<\/h5>\n<p>Now shutdown the RPi and use Win32 Disk Imager. to read an .iso file from the SD card (we&#8217;ll reduce its size after)<\/p>\n<h5>Alter the .iso file size for the final SD card<\/h5>\n<p><a href=\"https:\/\/www.dropbox.com\/s\/pubp8zgm2m7jb0w\/IBEX%20File%20Size%20Changer.zip?dl=0\">Download our\u00a0IBEX File Size Changer app from here<\/a><\/p>\n<p>Using this app open your .img\u00a0file:<\/p>\n<p><a href=\"https:\/\/raspberry-projects.com\/pi\/wp-content\/uploads\/2012\/10\/ibex_file_size_changer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2364\" src=\"https:\/\/raspberry-projects.com\/pi\/wp-content\/uploads\/2012\/10\/ibex_file_size_changer.png\" alt=\"ibex_file_size_changer\" width=\"551\" height=\"316\" srcset=\"https:\/\/raspberry-projects.com\/pi\/wp-content\/uploads\/2012\/10\/ibex_file_size_changer.png 551w, https:\/\/raspberry-projects.com\/pi\/wp-content\/uploads\/2012\/10\/ibex_file_size_changer-300x172.png 300w, https:\/\/raspberry-projects.com\/pi\/wp-content\/uploads\/2012\/10\/ibex_file_size_changer-60x34.png 60w, https:\/\/raspberry-projects.com\/pi\/wp-content\/uploads\/2012\/10\/ibex_file_size_changer-150x86.png 150w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/a><\/p>\n<p>The .img\u00a0file is simply a byte mirror copy of the SD card.<\/p>\n<p>You can uncheck\u00a0the\u00a0checkbox as we don&#8217;t care what the values of the bytes to be removed are in the unused space at the end of the card. \u00a0Enter the new file size in bytes you calculated above and press &#8216;Change The File Size&#8217;.<\/p>\n<p>That&#8217;s it, write the\u00a0image to the smaller SD card and it should work fine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may want to resize your partition to solve an issue with Win32 Disk Imager not being able to write to a new card due to it being slightly too small, or to change\u00a0to a smaller SD card. Here&#8217;s what we want to do: Resize the linux\u00a0partition on the SD card to fit within the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-2163","post","type-post","status-publish","format-standard","hentry","category-pi-operating-systems"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=2163"}],"version-history":[{"count":20,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2163\/revisions"}],"predecessor-version":[{"id":2982,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2163\/revisions\/2982"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=2163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=2163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=2163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}