Resize SD Card on Raspberry Pi

Posted by: Admin

Resize SD Card on Raspberry Pi - 12/09/20 01:03 AM

There are no utilities included for automatic file system re-sizing. However, it’s not hard to do manually. Once booted:

sudo fdisk /dev/mmcblk0

This is the command that will enter an “interactive mode” to manipulate this partition containing Ubuntu MATE, which is identified as “mmcblk0”.

Delete the second partition (d, 2), then re-create it using the defaults (n, p, 2, enter, enter), then write and exit (w).

Press the keys in that order:

d → 2 to delete the existing structure.
n → p → 2 → Enter ↵ → Enter ↵ to re-create to use all remaining space.
You should just check that each operation is successful before proceeding to the next key. If you’re curious, press “h” to display command help.

Reboot the system, then:

sudo resize2fs /dev/mmcblk0p2

Now that the partition boundaries have been resized, the actual filesystem needs to be resized to use the new space. Once this command is complete, your Raspberry Pi is now using all of the available SD card space.