Most of the Linux distributions available for the Banana Pi can be downloaded as a disk image from Lemaker's web site. Most of these images take up 4GB when unpacked and copied to an SD card. There's a small Fat16 partition used for storing boot files, and a 3.7GB ext4 partition for storing the root file system.
When you install updates on a new disk image, you may find that the Linux partition fills up before all the updates have installed. It's a good idea to use an 8GB card (or larger), and resize the partition so that it fills the entire card.
If there's any important data on your SD card, you should back it up before you make any changes.
The card shouldn't be mounted while you resize it, so you need to put it in an SD card reader and plug it in to a Linux PC. If you have a spare SD card, you can boot a Banana Pi with one SD card, and use it to resize the Linux partition on a second SD card.
Use this command to view the disks and their partions:
If you're not using a desktop environment, you can resize the partition from the command line using the fdisk command:
Fdisk will display a prompt where you can enter simple commands. You're going to need to delete the second partition, create a new larger one, and write the changes to disk. The partition table will be updated, but the data in the partition will be untouched.
When you create the new partition you'll be prompted for a type, primary or extended. Type 'p' for primary, and enter '2' when prompted for the partition number. When prompted for the first and last sector numbers, just press enter to use the default values selected by fdisk.
The next step is to type 'w' to write the changes to the card. Fdisk will automatically quit after this.
Reboot your Banana Pi so that the partition table gets reloaded. At this point, the partition is much larger, but the file system only occupies half of it. The final step is to enlarge the file system so that it fills the partition. The next two commands check the integrity of the file system and then resize it:
The partition and its file system should now occupy the whole SD card.
Some Linux distributions are supplied with a graphical tool called Gparted, which is available in the Fedora image for the Banana Pi. It's available on many PC Linux distributions by default. If you're using Fedora on your Banana Pi, you can use Gparted instead of fdisk.
Before you start, make sure the card is plugged into an SD card reader, and make sure the card isn't automatically mounted. Launch Gparted by going to the Application Menu -> System -> Gparted.
Select the card that you want to edit from the drop down menu on the right hand side of the tool bar. In this case it's /dev/sda. Click on the partition /dev/sda2, go to the Partition menu, and select Resize/Move.
Click the Apply button on the Gparted tool bar to write the changes to the card. The partition will be enlarged, and the file system is automatically expanded to fill the partition.
Share this page: