Main Content

ExtendLinuxPartition on SD Card

Note

For Raspbian Linux®image, you must manually extend the partition space on the SD card as described in this section. For all other Raspbian images, the partition space is automatically extended.

The firmware update for Raspberry Pi™ hardware burns a Raspbian Linux image on an SD card. This Linux image uses approximately 3.5 GB of the SD card. If you use an SD card whose size is greater than 3.5 GB, some unused space remains on the SD card. To use the full capacity of the SD card, you can use the “raspi-config” program available with Raspbian Linux.

  1. Enter the following commands in the MATLAB®Command Window:

    h = raspberrypi h.openShell()

    This command sequence launches a PuTTY SSH shell to your Raspberry Pi hardware.

  2. Log in to the Raspberry Pi hardware with your user name and password.

  3. Enter the following command in the SSH command shell:

    sudo raspi-config

  4. On theraspi-configmenu, selectAdvanced Optionsand then selectExpand.

  5. PressEnter. The following message is displayed.

    Raspberry Pi Linux Partition Extension Message

  6. SelectOK.

  7. On theraspi-configmenu, select theFinishoption, and pressEnter.

  8. Enter the following command in the SSH command shell:

    sudo shutdown -r now

  9. PressEnterwhen the menu displays:Would you like to reboot now?

  10. SelectYes.

  11. When the Raspberry Pi board finishes rebooting,raspi-configautomatically resizes the Linux partition on the SD card to occupy the remaining space.

    The boot process takes longer than usual for larger SD cards.