Backup: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Removing all content from page)
(Undo revision 161212 by Shit for brains (Talk))
Line 1: Line 1:
This page is intended for XO users who want to 'backup' the entire storage memory state of their OLPC XO, that is, 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.

This backup technique uses the 'save-nand' command in OpenFirmware. If you know of alternate techniques, please write them into this wiki.

=== 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#Getting a Developer Key for your Running XO Laptop|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 ===

Some of these steps are optional, included to boost reliability and confidence. Press the (enter) key after typing commands at the 'ok' prompt.

# Ensure the USB memory device is formatted as FAT or FAT32 or VFAT. Factory-formatted devices are apparently preferred or least troublesome.
# Ensure there is at least 1 GB (1024 MB) of free space available on the USB memory device.
# 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.
# Insert your USB memory device into one of the USB ports on the XO.
# (optional) At the OFW 'ok' prompt, type: <tt>probe-usb</tt>
# (optional) Ensure your USB device shows up as a USB2 device. USB1 is too slow. (Compare the output of <tt>probe-usb</tt> with and without the USB memory plugged in.)
# (optional) Type: <tt>dir u:</tt>
# (optional) From bytes used, deduce that there is at least 1 GB of available free space.
# Type: <tt>save-nand u:backup.img</tt><br>(The filename 'backup.img' may be something else such as 'my759bak.img'; use a short 8.3 format filename, and stay with the .img extension.)
# 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'.
# Type: <tt>dir u:</tt> (if you wish to see the final contents of USB memory).
# Remove the USB memory device. Your backup is now complete.
# 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 ===

# 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.
# Insert your USB memory device into one of the USB ports on the XO.
# At the OFW 'ok' prompt, type: <tt>probe-usb</tt>
# Ensure your USB device shows up as a USB2 device. USB1 is too slow.
# Type: <tt>dir u:</tt>
# Verify that your desired '.img' and '.crc' files are there.
# Type: <tt>copy-nand u:backup.img</tt>
# Wait til done, then remove the USB memory device, then restart your XO!

=== Notes ===

This procedure becomes easy after you have done it 3 times.

Some brands of USB memory work better than others. Backups in the 10-minute range for half-full XO's are achievable. If save-nand is too slow, then try a different brand of USB memory. 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.

There are variations possible, for example using an SD flash memory device (use sd: instead of u: for the OFW commands). 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?).

OpenFirmware is designed to be simple, reliable, and powerful, but not idiot-proof. Using the recipe given above will usually work well. Deviations could make trouble or confusion unless you know what you are doing. You have been warned!

Revision as of 23:38, 7 September 2008

This page is intended for XO users who want to 'backup' the entire storage memory state of their OLPC XO, that is, 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.

This backup technique uses the 'save-nand' command in OpenFirmware. If you know of alternate techniques, please write them into this wiki.

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

Some of these steps are optional, included to boost reliability and confidence. Press the (enter) key after typing commands at the 'ok' prompt.

  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. (optional) At the OFW 'ok' prompt, type: probe-usb
  6. (optional) Ensure your USB device shows up as a USB2 device. USB1 is too slow. (Compare the output of probe-usb with and without the USB memory plugged in.)
  7. (optional) Type: dir u:
  8. (optional) From bytes used, deduce that 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'; use a short 8.3 format filename, and stay with the .img extension.)
  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 device. USB1 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

This procedure becomes easy after you have done it 3 times.

Some brands of USB memory work better than others. Backups in the 10-minute range for half-full XO's are achievable. If save-nand is too slow, then try a different brand of USB memory. 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.

There are variations possible, for example using an SD flash memory device (use sd: instead of u: for the OFW commands). 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?).

OpenFirmware is designed to be simple, reliable, and powerful, but not idiot-proof. Using the recipe given above will usually work well. Deviations could make trouble or confusion unless you know what you are doing. You have been warned!