Friday 17 October 2014

How to Increase Memory of Beaglebone Black

Ya I know the previous versions of the Beaglebone Black has only 2GB of eMMC memory out of which the OS takes up 1.5GB. I have done a lot of internet search and read a whole lot of blogs. Finally I got a solution from the official BBB wiki page at eLinux. But still you may face some difficulties in doing it. Since this blog is for the noobs. I will write the steps in a noob friendly way, because I know what mistakes you can make since I have also made the same.



What you Need

  • Beaglebone Black
  • USB cable
  • Micro-SD card (8gb will be good if you want to install a hell lot of software packages)
  • PC with Internet connection and Putty installed.

Downloading and booting Debian Image

Believe me the new Debian distribution of BBB is a lot better than the other two variants available. It comes pre-installed  with a lot of useful software packages like Apache, OpenCV, TightVNC etc. So I will be using the Debian Image for this demo.

  • Download the latest Debian image from this page.
  • Warning: Do not download the "eMMC flasher" version. Because due to some reason I don't understand, you cannot use both the eMMC and the micro-SD card as your filesystem at a time.
  • Write the image and install the OS using the instruction on this page.
  • Since we will be booting from the SD card directly it wont take much time to boot up your board. Once booted you will find a new removable drive in your Computer.

  • Now login using Putty like I showed in my previous post.

Checking Linux Filesystem

Now lets see how much space is left on your Debian file system.
  • Type the following commands
 df -h  


  • You will get a table showing your total root filesystem size,  used and available memory.
  • The first entry that is the "rootfs" denotes your root filesystem. At the bottom of the table you will also get your memory card as a device showing around 7.2GB of size.
  •  Since I have already done the procedure my rootfs is showing 5.2G of free space but previously it was only 60M
  • Note the file name that denotes your memory card. In my case it was 

 /dev/mmcblk0p2  

Repartitioning the Memory Card

The Debian image provided in the support page is only for 2GB memory card. So the remaining space remains unused. We will use the fdisk tool in Linux to format the file system.
  • Type the following commands
fdisk /dev/mmcblk0 
p
  • You will get a window like this

  • This is the fdisk tool interface. Now enter the following commands in this sequence

d
2
n
p
2
enter
enter
w
  • You may get screens like this
 
  • Now reboot your BBB by typing
reboot
  • Now the excess memory in your memory card has been formatted and repartitioned to linux file system format. But in order to use it you need to resize the "rootfs" partition. In order to do so we will use the command

resize2fs /dev/mmcblk0p2
  • Now check your file system by again typing 
 df -h  
  • You may see a screen like this. Notice that the available disk space is now 5.3GB .
  • Now you can install your favorite software packages and play with the BBB.

Some tips to remember

  • NEVER remove the memory card from the BBB(unless you are reinstalling the OS) otherwise your device will boot from the eMMC and you may loose all your data.
  • If you want to reuse your memory card with your windows PC or in any other device you may need to format the memory card.
  • After writing the linux image on your SD-card it will show only 96MB of total size. Don't be afraid. Your memory card is safe. The remaining memory has been formatted to linux file system which is not detected by windows.
  • In order to get back the entire memory you may use the SDFormatter.
  • Believe me this software was a life saver for me.

Spread the knowledge

I hope this post has been helpful to you. Kindly comment and share so that I can keep posting such tutorials and you may quickly find my blogs from google search. Thanks a lot!
 

9 comments:

  1. my says nothing to. but it only shoes the 1.7 gb

    ReplyDelete
  2. i have 2gb on my beaglebone black board we can cutomized according to our company ..now we have problem how to bring up u-boot in that, because we have increase memeory size..can please any guide .

    ReplyDelete
  3. What image did you use? The Debian 7.5?
    I'm trying to upgrade node.is but run in trouble as no available space. Have a 8GB card.
    Running the Debian 8.5 4GB image from SD.

    ReplyDelete
  4. Professionally written blogs are rare to find, however I appreciate all the points mentioned here. I also want to include some other writing skills which everyone must aware of.
    ยาแก้ปวดไมเกรน

    ReplyDelete
  5. TOTO - - The Metal Art of Iron
    Iron, titanium chainmail steel, venza titanium glow aluminum, and ford ecosport titanium iron are the essential titanium legs metals to the Roman Roman empire. where to buy titanium trim Iron is highly resistant to rust,

    ReplyDelete