(What is a Raspberry Pi? It's an inexpensive minicomputer, popular with hobbyists and educators.)

After doing several saving and restoring several images, I have found tools and a method that I'm happy with. I am using these with Raspbian, but they would work with other flavors, too.

Tools

Most instructions I found on the web say to use the Win32DiskImager. I used it a few times, and found it to not be particularly user friendly. In fact, it reverts back to the first device after completing an operation, which I didn't notice once and ended up unintentionally formatting the wrong drive, which was particularly UN-user-friendly (I still haven't finished cleaning up that mess). 

So then I stumbled across mention of the USB Image Tool in a forum post somewhere. This thing is awesome. FIRST, it is more selective about which devices it shows (also shows much more details about the selected device, and can optionally show more devices). ALSO, it can keep track of favorite images, for easy selection and restoral. ALSO, you can restore an image that is bigger than the target device (not all flash cards of the capacity are truly the same capacity). ALSO, it can automatically compress the image file (and also use it for restoral) so you can skip the zeroing step on the Pi. So that's four major pluses in my opinion. Additionally, there are a number of options that can enhance user experience. Why would anyone use the Win32DiskImager?

On the Pi itself, I use gparted to reduce the size of the main image of the SD card. This is necessary because not all SD cards of the same nominal capacity have the same actual capacity. Due to bad areas of the flash, etc. one flash card might be smaller than another. So we want the OS to only use the lower "safe" portion of memory, which we are pretty sure will be usable on all of our SD cards. So, use gparted to reduce the partition and move it all the way down against the boot partition. This process only needs to be done once. In the USB Image Tool, be sure to select the option to truncate oversize images. This allows us to write an image even if it's bigger, and we know it's going to be ok because we reduced the memory area that the OS actually uses (so the "oversize" area is not even valid in the image).

There's really only one tool needed on the Pi itself for the every-time preparation: BleachBit. I use this to reduce the size of the data on the Pi before creating a copy. It's really easy to use. Just select which items you want to clear and it does the rest.

Method

One-time: Reduce the size of the main flash partition (not /boot)

  * Use gparted (I reduce to 7500 megabytes on an 8GB SD card)

One-time: Remove unneeded stuff (all in sudo), only need to do this after initial Raspbian setup

  > rm -rf python_games

  > rm -rf opt     # code examples

  * (?) Remove development packages (may want to keep in some situations)

    > sudo apt-get remove `sudo dpkg --get-selections | grep "\-dev" | sed s/install//`

  * (?) Remove python (may want to keep in some situations)

    > sudo apt-get remove `sudo dpkg --get-selections | grep -v "deinstall" | grep python | sed s/install//`

  * Remove older gcc

    > sudo apt-get remove gcc-4.4-base:armhf gcc-4.5-base:armhf gcc-4.6-base:armhf

Save disk image

  * Select stuff to remove in bleachbit

    > sudo apt-get install bleachbit secure-delete

  * Fill freespace with zeros using secure-delete

    % Note: this can take a while and is not necessary if using USB Image Tool's img.gz

    > sudo swapoff -a  # turn off swapping

    > sfill -llz

  > sudo shutdown now

  * Create an image using USB Image Tool and select a type that compresses the image.

Traffic Question 15: Mailing a letter

Traffic Question 15:

During a period of heavy traffic, you want to mail a letter and then head in the direction of the pink arrow. How do you do it?

  1. Stop at Mailbox A, then do a U turn
  2. Park in a spot near Mailbox A, then turn left out of the parking lot
  3. Use Mailbox A, then use the left turn lane at the intersection to do a legal U turn
  4. Turn right at the main street, turn left into the parking lot for Mailbox B, then go through the intersection in the desired direction

Traffic Question 14: A traffic light turns yellow and you’re not quite going to make it through before it turns red... what do you do?

Traffic Question 14:

A traffic light turns yellow and you’re not quite going to make it through before it turns red... what do you do?

  1. Stomp on the gas pedal and zoom through
  2. Continue through the intersection without any change in speed
  3. Wait until the last second and then stomp on the brake
  4. Start coming to a gradual stop immediately
  5. None of the above

Traffic Question 9: If you get a phone call while you’re driving, what do you do?

traffic-09q.pngTraffic Question 9: If you get a phone call while you’re driving, what do you do?

A. Answer it right away

B. Wait until you get to a stop light and call back.

C. Stop at a stop sign and call back.

D. See who it is. If you think it might be an emergency, park the car in a designated parking area and then call back.

(Yes, this is pretty similar to #2 If you get a text while you’re driving... The main difference is, texting on the phone is illegal whereas talking on the phone is legal. At least in Moline.)

Traffic Question 12: Which of the following are factors in whether or not a vehicle is going to be slower than normal?

Traffic Question 12:

Which of the following are factors in whether or not a vehicle is going to be slower than normal?

* Car is Buick, Cadillac, or similar type

* One or more children are present

* Vehicle is a minivan

* Age of driver is over 60

* Handicapped license plates

* Driver is using cell phone

* Vehicle is a "sporty" color

* Driver is female

Traffic Quiz 6: Is it possible to back out of a driveway and use only one lane?

traffic-06q.pngTraffic Question 6:

The blue dots indicate the path used to pull IN the driveway.

Is it possible to back out of a driveway and head in the direction indicated by the pink arrow, using only one lane of the road?

A. No, one lane is not enough room.

B. Yes, it can be done in one lane.