{"id":2169,"date":"2015-07-02T16:39:30","date_gmt":"2015-07-02T16:39:30","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=2169"},"modified":"2015-07-03T16:45:07","modified_gmt":"2015-07-03T16:45:07","slug":"expand-filesystem-issues","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/pi-operating-systems\/raspbian\/troubleshooting\/expand-filesystem-issues","title":{"rendered":"Expand Filesystem Issues"},"content":{"rendered":"<h4>\nGetting&nbsp;&quot;There was an error running option 1 expand filesystem&quot;<br \/>\n<\/h4>\n<p>\nThis is based on&nbsp;<a href=\"https:\/\/www.chrisnewland.com\/resize-raspberry-pi-sd-card-partition-to-fill-32gb-card-from-a-running-raspberry-pi-245\">https:\/\/www.chrisnewland.com\/resize-raspberry-pi-sd-card-partition-to-fill-32gb-card-from-a-running-raspberry-pi-245<\/a> but here for our own reference in case the other page ever goes away!\n<\/p>\n<p>\nBackup your SD card to an image file first!\n<\/p>\n<p>\nEnter this to see the current partition usage:\n<\/p>\n<p style=\"margin-left: 40px;\">\ndf\n<\/p>\n<p>\nE.g.\n<\/p>\n<pre>\r\n<code>\r\nFilesystem     1K-blocks    Used Available Use% Mounted on\r\nrootfs           3698504 3351472    146524  96% \/\r\n\/dev\/root        3698504 3351472    146524  96% \/\r\ndevtmpfs          494800       0    494800   0% \/dev\r\ntmpfs              99820     240     99580   1% \/run\r\ntmpfs               5120       0      5120   0% \/run\/lock\r\ntmpfs             199620       0    199620   0% \/run\/shm\r\n\/dev\/mmcblk0p1     57288   19400     37888  34% \/boot\r\n<\/code><\/pre>\n<p>\nThe rootfs and \/dev\/root is the same thing, its just a debian thing the have them both appear as seperate\n<\/p>\n<p>\nEnter this:\n<\/p>\n<p style=\"margin-left: 40px;\">\nsudo fdisk \/dev\/mmcblk0\n<\/p>\n<p>\nThen press &#39;p&#39; to see the current partitions on the disk. &nbsp;E.g.\n<\/p>\n<pre>\r\n<code>\r\nDisk \/dev\/mmcblk0: 7860 MB, 7860125696 bytes\r\n4 heads, 16 sectors\/track, 239872 cylinders, total 15351808 sectors\r\nUnits = sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0xa6202af7\r\n        Device Boot      Start         End      Blocks   Id  System\r\n\/dev\/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)\r\n\/dev\/mmcblk0p2          122880    15351807     7614464   83  Linux\r\n<\/code><\/pre>\n<p>\nNow delete the 2nd partition (it won&#39;t actually delete the data on it)\n<\/p>\n<p>\nPress &#39;d&#39; &gt; Enter\n<\/p>\n<p>\nPress &#39;2&#39; &gt; Enter\n<\/p>\n<p>\nNow re-create it:\n<\/p>\n<p>\nPress &#39;n&#39; &gt; Enter\n<\/p>\n<p>\nPress &#39;p&#39; &gt; Enter\n<\/p>\n<p>\nPress &#39;2&#39; &gt; Enter\n<\/p>\n<p>\nEnter the First sector and the same value as the original \/dev\/mmcblk0p2 partition (122880 from the above example).\n<\/p>\n<p>\nFor the Last sector just press enter to use the maximum value.\n<\/p>\n<p>\nNow press &#39;p&#39; &gt; Enter to see the new partition setup.\n<\/p>\n<p>\nFinally press &#39;w&#39; &gt; Enter to write it\n<\/p>\n<p>\nNow reboot:\n<\/p>\n<p style=\"margin-left: 40px;\">\nsudo shutdown -r now\n<\/p>\n<p>\nOnce its back do the resize\n<\/p>\n<p style=\"margin-left: 40px;\">\nsudo resize2fs \/dev\/mmcblk0p2\n<\/p>\n<p>\nThis may take a little while to complete&#8230;\n<\/p>\n<p>\nNow enter the command\n<\/p>\n<p style=\"margin-left: 40px;\">\ndf\n<\/p>\n<p>\nand hey presto, you&#39;ve expanded to&nbsp;use&nbsp;all the space :-)\n<\/p>\n<pre>\r\n<code>\r\nFilesystem     1K-blocks    Used Available Use% Mounted on\r\nrootfs           7513804 3352360   3810208  47% \/\r\n\/dev\/root        7513804 3352360   3810208  47% \/\r\ndevtmpfs          494800       0    494800   0% \/dev\r\ntmpfs              99820     240     99580   1% \/run\r\ntmpfs               5120       0      5120   0% \/run\/lock\r\ntmpfs             199620       0    199620   0% \/run\/shm\r\n\/dev\/mmcblk0p1     57288   19400     37888  34% \/boot\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting&nbsp;&quot;There was an error running option 1 expand filesystem&quot; This is based on&nbsp;https:\/\/www.chrisnewland.com\/resize-raspberry-pi-sd-card-partition-to-fill-32gb-card-from-a-running-raspberry-pi-245 but here for our own reference in case the other page ever goes away! Backup your SD card to an image file first! Enter this to see the current partition usage: df E.g. Filesystem 1K-blocks Used Available Use% Mounted on rootfs 3698504 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[],"class_list":["post-2169","post","type-post","status-publish","format-standard","hentry","category-troubleshooting"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2169","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=2169"}],"version-history":[{"count":5,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2169\/revisions"}],"predecessor-version":[{"id":2176,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/2169\/revisions\/2176"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=2169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=2169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=2169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}