Programming Robots Study Group – Pi Images 1

Wikis > Robotics > Programming Robots Study Group – Pi Images

Raspberry Pi Images

We are making available Raspberry Pi images for the B, B+ and Pi2. The following documents how to create an image for yourself.

While tested, you use this image and directions at your own risk. No warranty is expressed or implied.

Prerequisites

  • You must have a Raspberry Pi B or B+ or a new Pi 2 B.  These images are not tested on Raspberry Pi A and there are no plans to create an image for the A.
  • You must have a 16GB or 32GB SDCard that is empty or has data you can lose. This process will destroy any existing data on your card.
  • You must have a means to insert the SDCard on your PC.  You can use a USB card reader if you do not have a slot to mount an SDCard.
  • If you are not running a Linux distribution, you must determine how to put the image on your SDCard yourself.  Attempts to use the Programming Robots Study Group Virtual Box image have not been successful.  If you resolve this issue, please document your process and share it with us.
    • Daniel has tested and confirmed that the instructions will work with Cygwin as well.

Notes

If there is anything on the SDCard you need to keep, you MUST back it up.  The steps in this document will destroy all data on the SDCard and any data on it will be unrecoverable.

These steps were  performed on Ubuntu 14.04.  They should work with most Linux distributions.  Although it is possible to use the img files provided and create the SDCard in Mac or Windows, it is upon the reader to determine how to restore them to the SDCard.

The image files are here: http://blobs.robotgarden.org/raspberry_pi_images/  Please choose the correct image for your size SDCard and Pi model.  Both the model B and B+ use the same image.

Steps

  1.  Do not insert the SD Card yet, or if you have already, remove it.  Open a Terminal session (ctrl-alt-t in most Linux distributions will open one for you)
  2. Type the following command and press enter:
      df -h
  3. You should see something similar to the following:
     jannie@Ahwahnee:~/Desktop/pi2_img$ df -h
     Filesystem      Size  Used Avail Use% Mounted on
     /dev/sda1       215G  115G   89G  57% /
     none            4.0K     0  4.0K   0% /sys/fs/cgroup
     udev            2.9G   12K  2.9G   1% /dev
     tmpfs           581M  1.3M  580M   1% /run
     none            5.0M     0  5.0M   0% /run/lock
     none            2.9G  200K  2.9G   1% /run/shm
     none            100M   52K  100M   1% /run/user
  4. Insert the SDCard into your PC
  5. Type the following command and press enter:
     df -h
  6. You should see output similar to below if you have auto-mount enabled.  If not, see 6.1 for an alternate method of finding your cards device.  Note the last 2 are new – you may have 1 or many similar new mountpoints:
     jannie@Ahwahnee:~/Desktop/pi2_img$ df -h
     Filesystem      Size  Used Avail Use% Mounted on
     /dev/sda1       215G  115G   89G  57% /
     none            4.0K     0  4.0K   0% /sys/fs/cgroup
     udev            2.9G   12K  2.9G   1% /dev
     tmpfs           581M  1.3M  580M   1% /run
     none            5.0M     0  5.0M   0% /run/lock
     none            2.9G  200K  2.9G   1% /run/shm
     none            100M   52K  100M   1% /run/user
     /dev/mmcblk0p3   27M  397K   25M   2% /media/jannie/SETTINGS1
     /dev/mmcblk0p5   60M   15M   45M  25% /media/jannie/BOOT1

    /dev/mmcblk0p6   13G  5.2G  7.1G  43% /media/jannie/root1

    1. For those who do not have automount, before inserting the sdcard, tail dmesg, then insert and look for something similar to this (note yours may be sdb/c instead of mmcblk0:
      [19603.604891] mmc0: new high speed SDHC card at address e624
      [19603.610770] mmcblk0: mmc0:e624 SU16G 14.8 GiB
      [19603.612400]  mmcblk0: p1
  7. Take note of the first column – in this example /dev/mmcblk0p3.  This represents the device and partition(s) of the SDCard – in this example the device is /dev/mmcblk0 and the p3 and p5 are the partitions.  Yours may be more like /dev/sdc1, /dev/sdc2.  If this is th case, the numbers are the partitions, the /dev/sdc is the device.
  8. Unmount any mount points on the SDCard by passing the directory that the mount point was mounted on (indicated in the last column) to the umount command.  You need to be root to unmount typically:
      sudo umount /media/jannie/SETTINGS1
  9. Now the df command should no longer reflect your SDCard, but it should still be connected to your PC and you are ready to write the image.
  10. Copy the correct img file (16GB or 32GB) to your local disk.
  11. Now we will write the image to your SDCard. Once you execute this command, the data on the device will be destroyed and the new image written to it.  Please take extra caution to make sure it is the device that is your sdcard as this cannot be undone and if you pass your hard drive device, you will destroy your OS irrevocably!  If you are unsure, have someone with experience help you.  The dd command will not send anything back to the prompt. Writing the image will take a long time. Even though you don’t see anything happening, the image is being written. It’s not uncommon for this to take more than 30 mins with bs=1M – bs=4M will be faster and probably will also work). Your command should look something like this (note that the argument passed to ‘of’ is the device path (without partitions) from previous df commands:
     dd if=/path/to/raspberrypi_img.img of=/dev/mmcblk0 bs=1M
  12. Once completed you should have output that indicates how much data was written.  You can now remove your SDCard.
  13. If you’re using the Raspberry Pi 2 16GB image, you will want to resize your partition to get the extra space.  If you don’t know how to do this, it won’t prevent you from using it, but you won’t have all your space.  You can see Janelle and she’ll assist.
  14. Put your SDCard in your Raspberry Pi and boot.  The OS should boot, but I have found sometimes that it will drop to a command prompt with an error indicating fsck needs to be run.  If you run into this and are headed (using a keyboard and monitor), at the prompt in the Raspberry Pi type the following and hit enter:fsck -y /
    If you are headless (no keyboard or monitor) you can do the same by mounting the sdcard partitions and running the command:sudo fsck -y /path/to/mounted/root
  15. Reboot the Raspberry Pi with this command:
     shutdown -r now

That’s it – if you run into problems after this, please contact us.

Did you like this? Share it:

One comment on “Programming Robots Study Group – Pi Images

  1. Bruno Oct 1,2015 12:04 pm

    Can you please make an image from ros full desktop installation for raspberry pi 2?
    I am searching on the internet and i cannot find it
    so many thanks

Comments are closed.