KludgeCode

is Ben Rudgers

Easy to Use

I have Amazon Prime and it comes with free two day shipping and technically my order arrived in two days. If just the five pack of ethernet cables arriving counts technically. The Raspberry Pi 3’s arrived a day later along with the 60w USB recharging station. The sdcards and the switch are ‘delayed’ according to the Amazon status page. Who the hell knows where Monoprice’s fulfilled by Amazon USB cables are.

Anyway, I’m fished an Lexar 8GB micro-sd card out of my old Nokia E71. I’ve backed up the photos and videos off it just to be safe [I think I’ve already got all of them, but backing up is faster than verifying…if it were all cryptographically hashed and living in git that’d be easy…maybe one day? The Nokia E71 came with a 6″ USB A to micro-A cable for tethering a computer. Rest assured that it was not nearly long enough to be convenient in any of the eight USB ports on my Dell Precision tower and the 180 degree twist just made it that much worse and even made hooking it into a laptop less than ergonomically ideal. But it was in the bag with the E71 and it’s not assigned to anything else…by which I mean that if I forget to throw it in a bag when I’m travelling I won’t be sorry.

So now that I’ve got an SD card getting one of the Raspberry Pi’s up and running should be…well Raspberry Pi’s are easy to use right? The Raspberry Pi is easy for an embedded system and not especially difficult for a Linux system which is to say that compared to a Windows or Mac or a smartphone it’s not all that easy unless you buy the NOOBS microSD along with your Raspberry Pi.

After the backup, I reformatted the Lexar micro-SD and it being Linux and having run Linux as my primary OS for several years I used ext4 and then followed the instructions for installing the Raspbian image; stuck the card in a Pi; hooked up monitor, keyboard and power and…nothing. So I waited. Still nothing. Maybe I need to be on the network [I remember something about needing an NTP (network time protocol) service]…nope.

Pull the card, go back to the big machine and start Googling. Card needs to be Fat32 and I’m going to use it to start up the Raspberry Pi, so I’ll just use Ubuntu’s Make Startup Disk tool and before I know it, I’ll be up and running. So I make the micro-SD ‘startupbable’ and then follow the instructions for installing Raspbian; stick it back in the Pi, wire everything up and …nothing.

More googling and hoping the thrid time is a charm and I read a bit deeper into the Raspberry Pi boot process and it turns out that it’s extra particular relative to GRUB or GRUB2 (the necessity of learning a bit about came about by needing to dual boot Windows and Linux…and on top of that wanting to boot both Windows XP x64 Professional and Windows 8 and they are two different bootloaders and on the Linux side booting CentOS 6 (my first distro) that uses GRUB and Bhodi Linux that uses GRUB2 and winding up with a good example of why the year of the Linux desktop will be ‘next year’).

So, under Raspbian, the Raspberry Pi boot sequence starts on the GPU and then chains to read a FAT32 ‘boot’ partition on the micro-SD card and then chains to read ‘/boot’ on a regular ext4 system partition.

+----------+      +-------------+        +--------------+
|          |      |             |        |              |
|  GPU     +-----o+ FAT32 boot  +-------o+ ext4 /boot   |
|          |      | partition   |        |              |
+----------+      +-------------+        +--------------+

A properly installed Raspbian sd-card image looks something like this diagram in gparted

+--------------+------------+--------------+------------------------------------+
|              |            |              |                                    |
|              |            |              |                                    |
|  unallocated | FAT32 Boot | ext4 System  |unallocated                         |
|              |            |              |                                    |
|              |            |              |                                    |
+--------------+------------+--------------+------------------------------------+

Since I mentioned gparted, that’s what I used next to delete existing partions and reformat the entire card to FAT32. Then I followed the instructions for installing Raspbian; stuck the card in a Pi; wired it all up; and third times a charm, it all worked.

For a Linux exercise it was not an atypical number of hours of pain and frustration on the road to the year of the Linux desktop. For an embedded system, it was probably an ‘easy to use’ experience. And now that one Pi is up and running, it’s almost reasonable to assume I can rest on my laurels and smoothly sail to a Swarm cluster…I mean how hard could it be?

Related Tags: [ , , ]