Backup

From OLPC
Revision as of 22:27, 6 September 2008 by Thomaswamm (talk | contribs) (reformatting)
Jump to navigation Jump to search

This page is intended for XO users who want to 'backup' the entire storage memory state of their OLPC XO, i.e., the internal 1 GB NAND flash memory, so that they can do a later 'restore' if needed to recover from a software disaster. Backup and restore are also useful for development testing of different software builds.

What you will need (besides an XO laptop)

  • a 1 GB (or larger) USB flash memory device (priced under Cdn$10 per GB as of Sep-2008)
  • a Developer Key (software access code) that lets you use OpenFirmWare (OFW)
  • 10 minutes to 3 hours (depending on your luck and skill)

To backup your XO

  1. Ensure the USB memory device is formatted as FAT or FAT32 or VFAT. Factory-formatted devices are apparently preferred or least troublesome.
  2. Ensure there is at least 1 GB (1024 MB) of free space available on the USB memory device.
  3. Start or restart your XO, while holding down the (X) Escape key at upper-left of the keyboard. This should get you to the OpenFirmWare 'ok' prompt.
  4. Insert your USB memory device into one of the USB ports on the XO.
  5. At the OFW 'ok' prompt, type: probe-usb
  6. Ensure your USB device shows up as a USB2.0 device. USB1.x is too slow.
  7. Type: dir u:
  8. Ensure there is at least 1 GB of available free space.
  9. Type: save-nand u:\backup.img
    (The filename 'backup.img' may be something else such as 'my759bak.img'; stay with the .img extension, and use a short 8.3 format filename.)
  10. Wait anywhere from a few minutes to a few hours as the XO copies its internal NAND flash memory contents over to the USB memory device. The displayed hexadecimal block count will count from 0 to 1FFF, at a varying speed, then OFW will report 'Done' and report the name of a CRC file such as 'backup.crc'.
  11. Type: dir u: (if you wish to see the final contents of USB memory).
  12. Remove the USB memory device. Your backup is now complete.
  13. You may copy the two files 'backup.img' and 'backup.crc' from the USB memory onto some other media, such as a Windows PC, for redundant backup or to free your USB memory device for other uses. Always keep the two files together.

To restore your XO

  1. Start or restart your XO, while holding down the (X) Escape key at upper-left of the keyboard. This should get you to the OpenFirmWare 'ok' prompt.
  2. Insert your USB memory device into one of the USB ports on the XO.
  3. At the OFW 'ok' prompt, type: probe-usb
  4. Ensure your USB device shows up as a USB2.0 device. USB1.x is too slow.
  5. Type: dir u:
  6. Verify that your desired '.img' and '.crc' files are there.
  7. Type: copy-nand u:backup.img
  8. Wait til done, then remove the USB memory device, then restart your XO!

Notes

Some brands of USB memory work better than others. If save-nand is too slow, try a different brand. Default factory-formatted USB memories are reported to work better than devices that have been reformatted, for example by a Windows PC. If you have a USB memory device that is working well with your XO, try to avoid ever reformatting it; delete files using file delete commands rather than device format commands. Backups in the 10-minute range for half-full XO's are achievable.

There are variations possible, for example using an SD flash memory device. But a USB memory device will generally be more convenient.

Accessing individual files from a backup.img file generally requires you to restore the entire backup to your XO. But perhaps there is some utility software that can access individual files from an .img file (does anyone know?).