This is an old revision of the document!
piCore Resize Partition
For reference: http://www.tinycorelinux.net/12.x/aarch64/releases/RPi/README
- sudo fdisk -u /dev/mmcblk0
- Print the current partitions with 'p'
- Make note of the starting and ending sectors of the second partition
Device StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type /dev/mmcblk0p2 1023,3,16 1023,3,16 172032 204799 32768 16.0M 83 Linux
- Delete the second partition with 'd'
- Create a new second partition with 'n' with same starting sector (StartLBA) and higher ending sector
- You might want to reserve some space (e.g. 1 or 2 GB) for swap space on devices with low amount of memory.
This is only needed if you expect to run out of memory e.g. during compiling a large program.
Normally this is not needed.
- Below the old and new second partition below each other.
Device StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type /dev/mmcblk0p2 1023,3,16 1023,3,16 172032 204799 32768 16.0M 83 Linux /dev/mmcblk0p2 1023,3,16 1023,3,16 172032 249737215 249565184 119G 83 Linux
You can delete (d) and re-create (n) the partition at this point if needed.
- Write the new created second partition with 'w'
- Reboot to use the new partition table.
- sudo reboot
- Enlarge the second partition to the new size with:
- sudo resize2fs /dev/mmcblk0p2
- Verify the result with:
- df -hT
To actual use the swap partition a few additional steps are needed. The results can be verified with: - free