Skip to content

Root partition resizing

Massimo Gaggero edited this page Jul 22, 2019 · 1 revision

Root partition resizing

After the installation of the TDM image on the microSD, the size of the root partition is about 3 GB and does not fit all the available space in the microSD. Moreover, there is no enough room for the Edge Gateway Operating System to work properly. Thus the partition must be resized as soon as the installation completes.

WARNING: the following instructions may corrupt the filesystems on the SD. Pay close attention to the names of the devices to which the commands are directed.

1. Modify the partition table:

sudo fdisk /dev/mmcblk0
  • type p to print the partition table
  • type d and 2 to delete the second partition
  • type n to recreate the second partition
  • accept all the default parameters hitting enter
    • remove the ext4 signature if asked
  • type w to write the new partition table and exit.

2. Resize the second partition:

sudo resize2fs /dev/mmcblk0p2

wait and don’t panic.

3. Reboot the system:

reboot

4. Login again as alarm:

5. Check the available space:

df -h

It should show two partitions, the boot partition, /dev/mmcblk0p1, and the root partition, /dev/mmcblk0p2, that now takes up all of the space to the end of the microSD device.