Expanding root filesystem

hi there. how can i expand root filesystem to install packages, use large docker images etc? 1gb is literally nothing :frowning:
i have 32gb sd card and being allowed to use only 1gb is sad.
i’ve tried some methods from internet but all of these failed.
thanks in advance

(i use rpi 4b 4gb if it makes any difference)

Sure!

So by default it’s 1Gb for root and the rest for SD Storage (for network attached storage features) but if you want to use docker you can certainly resize it. Here’s how (video and steps below):

Steps:

  1. In SSH, run cfdisk /dev/mmcblk0

  2. Using the up and down arrow keys, go to /dev/mmcblk0p3

  3. Then using right/left arrow keys go to delete (you could alternatively resize it) and hit enter

  4. Next, with up and down arrows scroll to /dev/mmcblk0p2

  5. With right/left arrows (with /dev/mmcblk0p2 highlighted) go to Resize

  6. It should suggest the unallocated storage on the SD - just hit enter to confirm

  7. Then using the right/left arrows go to the option for Write and hit enter. Type yes to confirm

  8. Go to Quit

  9. Reboot

  10. It should now be all done, you can run fdisk -l to verify it’s resized after rebooting

1 Like

i’ve tried that earlier but it was throwing me errors. after resetting it worked in fdisk, but still shows 971.94mb on status page, same goes on mount points page

docker also can’t be used for me

failed to register layer: no space left on device

Ok, will look into it, and follow up as soon as possible!

One thing I’ve seen suggested online (as the issue seems to step from the filesystem being set during first boot is):

  • Flash the SD Card with PiFi image
  • Resize using Gparted in Linux
  • Insert SD into Pi and boot (on first boot it will set to correct size)

This isn’t the most optimal way, other solutions like these (attempt 1, attempt 2) are not proving successful in my testing though.

Will see if I can find a more elegant fix!

how do i completely reinstall pifi from scratch? I’ve tried deleting partitions and reflashing image but got everything back running with old settings. where are they stored?
i will try gparted later then. thanks


i guess no luck here


got it by using cfdisk on ubuntu machine.

  1. write image to sd card
  2. do steps 1-8 from guide in 2nd reply on linux machine :slight_smile:
  3. boot

thanks for pointing me on that. hope you’ll find elegant fix for that

Awesome, glad you found a way, may release image versions without the SD storage partition so that just expands to fit the card (I would like to look into official docker integration in app too but could be a while before get around to that)

1 Like