Most Pi OS have raspi-config which includes an option to resize the filesystem.įailing this it can be done manually, assuming the distribution includes the necessary tools. While there are (paid) 3rd party programs, the easiest is a live Linux CD. You can NOT do this on a Mac, as there is no support for ext4.
Sudo resize2fs /dev/sda2 to expand the file system to fill the new partition W writes the partition information, reboot required if the partition was already mounted (as it was in this instance) not default) or take default to use the remainder of the disk Partition to resize is /dev/sda2 make note of Start (122880)Īt the prompt ( Command (m for help):) type the next letters and then press enter after each: Sector size (logical/physical): 512 bytes / 512 bytes List existing devices and partitions with sudo fdisk -l $ sudo fdisk -lĭisk /dev/mmcblk0: 7861 MB, 7861174272 bytesĤ heads, 16 sectors/track, 239904 cylinders, total 15353856 sectors
the results in this example were based on resizing the partition on an attached 500Gb USB hard drive You can do it all on the Pi if you have SSH or terminal access, below are some notes I made when I first did it, you shouldn't lose any data if you do it correctly but as always it pays to have a backup just in case :Īt a terminal prompt (you may need to amend the partition names depending on your layout/requirements) N.B.