Tuesday, November 18, 2014

Raspberry Pi: imaging the SD card on a Mac

Get started with RaspberryPi.org (link) or with Raspberry Pi on e14's website (link).
Most recently used "NOOBS Offline and network install".

So starting with the SD card inserted and mounted... in MY CASE ONLY, from an xterm using the df -h command, the device name (and therefore the 'raw device name') is disk1 (or rdisk1 or rdisk2 for its raw equivalent), I did the following...

1.

Check which device maps to the SD card. This is the high risk bit because you may end up formatting the computer hard drive, never a good thing to do unintended!
Check
$ df -h
Filesystem      Size   Used  Avail Capacity  iused  ifree %iused  Mounted on
/dev/disk0s2   112Gi  108Gi  3.6Gi    97% 28456655 955713   97%   /
devfs          184Ki  184Ki    0Bi   100%      636      0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%        0      0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%        0      0  100%   /home
map -fstab       0Bi    0Bi    0Bi   100%        0      0  100%   /Network/Servers
/dev/disk1s1   3.7Gi  832Ki  3.7Gi     1%        0      0  100%   /Volumes/XBMC
Check again
Write it down.
And check again. For example run ls on the disk path to verify you can and that you access and list the SD card.

2.
Next, unmount it using 'sudo diskutil unmount /dev/disk1s1' (my case only). The icon will also disappear from the desktop confirming this step was successful.
$ sudo diskutil unmount /dev/disk1s1

3.

The last step is to write the image file to the raw SD card device as identified above, replacing disk1s1 with rdisk1:
$ sudo dd bs=1m if=./raspbmc-2013-12-23.img of=/dev/rdisk1
After anywhere from 3 to 5 minutes the disk image write finishes. The xterm looked like this:
1300+0 records in
1300+0 records out
1363148800 bytes transferred in 243.253827 secs (5603812 bytes/sec)
And there's a shiny new disk labelled 'Untitled' on the desktop. At first impression it looks like your 4G or 8G sized disk has tragically shrunk to 60 or 70 MB. The reason is that the SD disk has or will have a Linux swap partition and a Linux filesystem partition occupying the available space. The good news is that most of the slack space can be recovered the first time you load this SD card on the Raspberry Pi via one of the Pi configurator (raspi-config) options to reallocate the space from the linux partition to the FAT32 partitio

Sharing 360° video?

So, you've got a 360 degree video file from your GoPro. What to do with it? Well, share it on YouTube. YouTube supports uploading and pl...