These are instructions on how to put Debian for Beaglebone Black (BBB) on a SD card without using an additional SD card reader.
Hardware required: Beaglebone Black and a GNU/Linux computer, both connected to the same LAN, and a micro SD card.
Computer software required: a web browser, wget, md5sum, 7zip, arp-scan, openssh, dd.
BBB software required: a working GNU/Linux running from the eMMC.
Fire up your computer’s terminal. Chdir into an initially empty directory.
1) Navigate to the official BBB webpage using your preferred browser:
http://beagleboard.org/latest-images/
2) Download the latest Debian (or other) image via wget. Choose beetween the bootable and flashing-only version (according to your personal preference). You can also download the file using browser or bit torrent.
wget http://debian.beagleboard.org/images/bone-debian-7.5-2014-05-14-2gb.img.xz
3) Check its MD5 hash (optional).
md5sum *.xz
4) Unzip the file using 7zip (the extracted file will look like this: IMAGE_NAME.img):
7z x *.xz
5) Make sure your BBB is connected to the same local network your machine is connected to using ethernet cable. Also make sure the SD card has been put into its slot after BBB had been turned on and booted up.
Find your local ethernet name. It should look something like eth0. You will be able to find it using this command:
ls /sys/class/net
6) Arp-scan your home network to find the BBB’s IP adress:
sudo arp-scan --interface=YOUR_ETHERNET_NAME --localnet
7) The IP address corresponding to Texas Instruments, Inc in the third column should be your BBB’s. Now you can ssh into your device. If you’re using the default Ångström distribution, just hit enter when asked for password:
ssh root@YOUR_BBBS_IP
8) List bulk devices to find your SD card’s device name.
lsblk -f && lsblk
9) Take this step very seriously since not doing so could do harm to your BBB in step 11. You should be able to find the SD card device name by its size, filetype and name. The BBB comes with a 2GB on-board flash so make sure to filter that one out. The SD may include some partitions, for example mmcblk1p1 and/or mmcblk1p2. In my case, the SD device name was mmcblk1. We will be using the SD_NAME in the following steps.
Memorise the SD_NAME (or better yet, write it down) and unmount all of its partitions:
umount SD_NAME_PARTITION_MOUNTPOINTS
Make sure they had been unmounted using lsblk again.
10) Exit your ssh session:
exit
11) Please take this final step even more seriously and follow at your own risk. We will be using the dd image writing command, also known as the Data Destructor. You could easily destroy all data either on your machine or BBB so proceed carefully.
Clone the image to the SD card using ssh:
dd if=./IMAGE_NAME.img | ssh root@BBB_IP "dd of=/dev/SD_NAME bs=4M"
if stands for input, of for output. This will take a while. You should get a coffee. Or make tea. Take a quick nap in front of your computer. Once it’s done, you should end up with a SD-card ready for eMMC flash or boot.