Tuesday, 8 July 2014

Booting the Beaglebone Black (BBB) from an SD Card and then Expanding the File System.

I recently acquired a BBB hoping it would be sort of a super Raspberry Pi and it is, but it is a bit different and I am a noob and can’t read instructions correctly. So here is the right way to get your BBB working properly with a massive filesystem so you can clog it up with all sorts of apt-get garbage.

The biggest difference between the BBB and the Rasberry Pi is that the BBB has approximately 3GB of eMMC on-board memory. When you consider that the preinstalled operating system takes up a good portion of that it is incredibly easy to fill the BBB to capacity - which is what I did five minutes after plugging it into my PC. Thankfully the BBB comes with a microSD card slot and is able to boot off that microSD card.

The first step is to flash the latest version of Bone Debian to the internal memory. Go to this page on the Beagle Board website and download the file that looks like: “Debian (BeagleBone Black - 2GB eMMC) 2014-05-14”. It’s under the heading: BeagleBone Black (eMMC flasher). Ångström linux will also work but its image hasn’t been updated since September of last year…

I usually use a Windows 7 PC so the following will be burning an image onto an SD card using Windows 7. There is a lot of software out there for burning images onto SD cards hard drives and any other storage medium. The software I like best is: Win 32 Disk Imager (it's Sourceforge, sorry). What’s good about this one is that it also allows you to read images from the SD card onto your hard drive, which means you can backup your SD card whenever you want to. Also remember to use the SD formatter if you need to format your SD card - if you use the Windows 7 format function it will take hours and when it is finished you will have a corrupted SD card.

You will also need to download 7z zip so you can unzip that image file. Extract the file to your chosen location. Put your micro SD card in a card reader and plug it in to PC. Load up Win 32 Disk Imager and click the blue folder icon next to the text box labelled image file, browse to and select the image file. There is a drop down box right labelled device next to it - make sure you select the correct device. You will see the read and write buttons are now active - make sure you click write. If you click read it will overwrite the image file you just download with the blank SD card image. In fact this is how you backup your SD card reading from the Linux image on an SD and writing to an image file on your hard disk.

This will take 5 to 10 minutes, after that pull the microSD out of your PC and stick it in the slot on the Beaglebone while it is powered down and disconnected from any power supply. This bit is a little bit tricky and some people will tell you to do it differently, but this is what I did and it worked. You hold down the USER/BOOT button and then plug your BBB into the power either using the USB cable that came with the board or a separate 5 V supply. The four LEDs at the other end of the board will start flashing wait a few seconds then you can let go of the button. It can take up to 40 minutes for the internal memory to be flashed, when it is finished the board will turn itself off (according to the documentation it’s not supposed to do this, but it is what mine did, others say it is finished when all four LEDs are on and have stopped flashing).

I would debate whether it is necessary to hold the USER/BOOT button because I applied power to my BBB forgetting to pull the SD card out and it reflashed the BBB again. If you are very frugal you can stop reading now and simply remove the SD card and go on your merry way. But if you are like me and want to install lots of crap keep reading.

I planned to use the same image to operate the BBB off the SD card, but it kept reflashing the internal memory everytime I rebooted it. If I knew more about Linux I probably could have found the flag or file that initiated the flashing and got rid of it. So, I downloaded another image off the Beagleboard site: “Debian (BeagleBone, BeagleBone Black - 2GB SD) 2014-05-14”. This one is under the heading: BeagleBone (Runs on BeagleBone Black as well without flashing the eMMC). I followed the same procedure as I did earlier this time burning that image onto the SD card.

And it worked. The only thing I needed to do next was to expand the file system. This can be a little bit tricky and counterintuitive to a Windows native, and I found a great tutorial that helped me to expand the filesystem.

No comments:

Post a Comment