MySQL for the Internet of Things

(Steven Felgate) #1

Chapter 6 ■ Building low-Cost MysQl data nodes


Linux


To create the SD card image using Linux, you need to know the device name for the SD card reader. Execute
the following command to see the devices currently mounted:


df -h


Next, insert the SD card or connect a card reader, and wait for the system to recognize it. Run the
command again:


df -h


Take a moment to examine the list and compare it to the first execution. The “extra” device is your SD
card reader. Take note of the device name (for example, /dev/sdc1). The number is the partition number.
So, /dev/sdc1 is partition 1, and the device is /dev/sdc. Next, unmount the device (I will use the previous
example).


umount /dev/sdc1


Use the following command to write the image, substituting the device name for and path and
name of the image file for (for example, /dev/sdc and my_image.img):


sudo dd bs=4M if= of=.


At this point, you should see the disk-drive indicator flash (if there is one), and you may need to be
patient. This step can run for some time with no user feedback. You will know it is complete when the
command prompt is displayed again.


Booting Up


To boot your Raspberry Pi, insert the SD card with the new image and plug in your peripherals. Wait to
plug in the USB power last. Because the Raspberry Pi has no On/Off switch, it will start as soon as power
is supplied. The system bootstraps and then starts loading the OS. You see a long list of statements that
communicate the status of each subsystem as it is loaded. You don’t have to try to read or even understand
all the rows presented,^10 but you should pay attention to any errors or warnings. When the boot sequence is
complete, you see a command prompt, as shown in Figure 6-10.


(^10) They go by so fast; it is unlikely you can read them anyway. Basically, they’re noise unless there is an error, and those
usually appear in the last few lines displayed.

Free download pdf