====== Write Image to SD Card ======
On the Beagle Bone Blue, there is already a preinstalled OS on the eMMC (internal flash memory). It is recommendet to use this OS. If using a newer version, it is not guaranteed that everything is already set up correctly since these images are made for different Beagle Bone board types.
It is recommended to use the following image since it fully supports the robotics cape library. With the images from 2018, the robotics cape library does not work due to an issue with the PRU-ICSS driver by the time writing this.
[[https://debian.beagleboard.org/images/bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz]]
The following steps describe how to install an OS image onto a SD card using a Linux host. Afterwards, the SD card can be inserted into the BeagleBone board. The board will boot from the SD card automatically.
1. Download the newest or desired image from: [[https://beagleboard.org/latest-images]]
2. Prepare an SD card. Backup all Data from the SD card since they will be lost after writing the image!
3. Compare hash of the image with the one on the download page to make sure the image was downloaded correctly. Use for example **sha256sum** program which is preinstalled on a standard linux desktop distributions already.
ntbler@ntbhost:~$ sha256sum bone-debian-8.7-iot-armhf-2017-03-07-4gb.img
943cc82959224ab49bf562b38088c2e20dd8596d1e9485b6490065459c9df178 bone-debian-8.7-iot-armhf-2017-03-07-4gb.img
4. The following steps are to determine which device is the SD card on the system.
* Run **lsblk** (in bash) before inserting the SD card.
* Insert the SD card.
* Run **lsblk** again.
* Read out the device name.
ntbler@ntbhost:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 111.8G 0 disk
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 7.9G 0 part [SWAP]
└─sda1 8:1 0 103.9G 0 part /
ntbler@ntbhost:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 111.8G 0 disk
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 7.9G 0 part [SWAP]
└─sda1 8:1 0 103.9G 0 part /
mmcblk0 179:0 0 29.7G 0 disk
└─mmcblk0p1 179:1 0 29.7G 0 part /media/ntbler/6230-3334
In the example above, the device name is **mmcblk0**.
5. Unmount the device with umount:
ntbler@ntbhost:~$ sudo umount /dev/mmcblk0
6. Now, the image can be copied onto the SD card using **dd**. **Make sure to not choosing the wrong device, otherwise you will destroy your filesystem and loose all your data!**
ntbler@ntbhost:~/images$ ls
bone-debian-8.7-iot-armhf-2017-03-07-4gb.img
ntbler@ntbhost:~/images$ sudo dd if=./bone-debian-8.7-iot-armhf-2017-03-07-4gb.img of=/dev/mmcblk0 bs=1M
3400+0 records in
3400+0 records out
3565158400 bytes (3.6 GB, 3.3 GiB) copied, 72.6061 s, 49.1 MB/ssha
7. Have fun with the new OS.
Useful Links:
* [[https://help.ubuntu.com/community/Installation/FromImgFiles]]
* [[https://www.raspberrypi.org/documentation/installation/installing-images/linux.md]]
* [[https://wiki.ubuntuusers.de/dd/]]