74 | | * [http://elinux.org/RPi_Resize_Flash_Partitions Resize the root] partition: |
| 74 | * update the OS |
| 75 | * sudo apt update |
| 76 | * sudo apt upgrade |
| 77 | * Fix the way raspbian references partitions (see info [https://www.raspberrypi.org/forums/viewtopic.php?t=192889 here]). If you don't do this and leave references using UUIDs, when you resize the root partition, raspbian will change the UUID and you won't be able to boot: |
| 78 | * sudo fdisk -l (list partitions) |
| 79 | * edit /etc/fstab |
| 80 | * Change the references to the /boot and / (root) partitions to use the /dev/mmclk0pX notation; after changes it should look like this: |
| 81 | {{{ |
| 82 | proc /proc proc defaults 0 0 |
| 83 | /dev/mmcblk0p1 /boot vfat defaults 0 2 |
| 84 | /dev/mmcblk0p2 / ext4 defaults,noatime 0 1 |
| 85 | }}} |
| 86 | * edit /boot/cmdline.txt to use the matching notation for the root partition: |
| 87 | * Change the root assignment to use the /dev/mmcblk0pX notation: |
| 88 | {{{ |
| 89 | root=/dev/mmcblk0p2 |
| 90 | }}} |
| 91 | * [http://elinux.org/RPi_Resize_Flash_Partitions Expand the root] partition: |
79 | | * sudo reboot (reboot to ensure larger partition is used) |
80 | | * wait and then re-connect to the Pi via SSH |
81 | | * Update the OS on the Pi: |
82 | | * sudo apt-get update |
83 | | * sudo apt-get upgrade |
| 96 | * sync (ensure all buffers are flushed to disk) |
| 97 | * sudo reboot (reboot to ensure larger partition is used) |
| 98 | * Wait and then re-connect via SSH |
| 99 | * Expand the root file-system to use the larger partition: |
| 100 | * sudo resize2fs /dev/mmcblk0p2 |
| 101 | * sudo reboot |
| 102 | * wait and then re-connect to the Pi via SSH |