In this tutorial we will explain how to expand the space in external micro SD card used by the file system in your BeagleBone Black.
Why we are expanding the File System Partitions?
Generally storage devices needs some structure that allows the operating system to locate and create new files.This is done by using Partitions and File systems. A partition is a section of a storage device, which is formatted with a File System, onto which the operating system creates a directory structure.By expanding the File Systems in the micro SD card we can utilize the rest of the place for storage purpose. Steps for Expanding the File Systems in External SD card
Insert the SD card in to your Beaglebone Black and boot it.After login,open your terminal.First become a super user from the command prompt of your beagleboneblack OS.
$ sudo su
If you don’t want to go super user mode just add ‘sudo’ infront of all the commands which we are going to use.
Ensure the available volumes on the SD card.Depending on your linux version it will show like this.I am running Debian with GUI(Debian installation steps click here) $ ll /dev/mmcblk*
To manage a Disk partitions we have to use fdisk command
$ fdisk /dev/mmcblk0
Then enter ‘p’ it should show a print statement.It prints the size of your SD card.Depending on the size of your SD card ,values may change.
Enter “d” command to delete a partition and mention the partition number as ‘2’ .Entering ‘p‘ again will show that you have deleted /dev/mmcblk0p2
Now create a new partition by entering ‘n’ then ‘p’ and then ‘2’
*p–>primary (partition type)
You can enter ‘p‘ again to see that the /dev/mmcblk0p2 has been re-appeared.
If everything goes fine enter ‘w’ to commit your changes or if you are finding any error ,Ctrl+z to stop the process.
Reboot your system.
After rebooting you need to expand the file system.Enter the command ‘df’ (remember: should be a super user).
df–> displays the total space and free space available on your system.
Then enter the following command to expand the file system.(It take some time to complete)
$ resize2fs /dev/mmcblk0p2
After completing the process again type ‘df’ to check the space available.Now you can access full space of your SD card.
Placing an order
For queries: firstname.lastname@example.org