Monday, November 24, 2014

Beaglebone Black microSD Imaging, Re-Sizing and Booting

I wanted to to install Debian on a larger drive, so we had a camera that expired which had a 16GB microSD card in it that I re purposed.

The following is what I did to get a 16GB Debian drive on my BBB and should work for larger drives too.

Imaging the microSD Card (http://beagleboard.org/getting-started#update)

First we need to install the OS image we want to run on the BBB to our microSD card. The steps are as follows:
  1. Get the latest image from here: http://beagleboard.org/latest-images
  2. Grab Win32DiskImager 
  3. Using 7Zip unzip the compressed image downloaded in step 1
  4. Insert the larger microSD card in your computer. You probably need a microSD to SD adapter.
  5. Start Win32DiskImager
  6. Press the blue folder icon located to the right of the Image File text box
  7. Select the microSD card to image using the Device pull-down menu
  8. When you are ready to image the microSD card press the Write button
  9. This process should take several minutes
Extend the 2GB Partition

Since the OS image is sized for a 2GB SD card and we're installing it on a larger SD card we need to extend the data partition to include the unallocated space on the SD card.  To accomplish this you will need vncserver running as root on the BBB. GParted is the program we will use to extend the filesystem which we will need to install.
  1. Install gparted (apt-get install gparted) on the BBB
  2. VNC into BBB
  3. Press the Debian start button (lower left corner) and select Run
  4. Type in gparted 
  5. Detailed instructions -  Step3 on how to use GParted
  6. Select the SD card to re-size under devices (upper right)
  7.  Select the ext4 partition on the graph
  8. Right click and select Resize/Move
  9. With the mouse grab the right side of the partition block and drag it all the way to the right
  10. Press the Resize/Move button
  11. Press the green check mark icon
  12. Acknowledge the resize action
  13. This action will take a few minutes... do not close gparted or shutdown BBB until it completes
Booting the BBB from the microSD Card
  1. With the BBB powered off insert the microSD card into the slot
  2. Press and hold the tiny button nearest the microSD card
  3. Apply power to the BBB
  4. Once all 4 LEDs light up release the tiny button nearest the SD card
  5. The BBB should now be running the OS from the microSD card
Updating the System
  1. Log in as root via Putty (you will get a certificate security warning)
  2. Make sure you have internet connectivity
  3. Run: apt-get update
  4. Run: apt-get upgrade
You should now have your OS installed on and booted from a larger drive.

You can also use Win32DiskImager to create an image file of the larger SD card for back up purposes.  Install any applications you desire on the new larger drive and then use Win32DiskImager to back the image up saving you from installing from scratch if the SD card ever fails.  Remember to back up the SD card image after any major changes so you don't have to re-complete them.

Until next time,

Cheers!


No comments:

Post a Comment