Moving current system from flash to SD

From Openmoko

Revision as of 22:42, 10 August 2008 by OlivierBerger (Talk | contribs)

Jump to: navigation, search

This is an attempt at describing how one can "backup" or move an existing current system running in the FR flash NAND to the micro SD card, in order to boot from it. See associate thread here.

Typical scenario :

  • running 2007.2 from flash
  • want to install OM 2008.8 without loosing the "backup" 2007.7 in cas of need, to be booted from SD

Necessary steps (to be confirmed, don't try this unless you know what you're doing !) :

  1. Establish a running system on SD (see Booting from SD)
  2. reboot from that alternate system on SD
  3. from that system on SD, transfer content of flash to a backup dir on SD (provided SD is big enough to hold 2 systems)
  4. flash with new system
  5. reboot under newly flashed system
  6. remove old system from SD's root (the one which was booted in before to do the backup)
  7. move the backup from the backup dir of the SD to the root of the SD
  8. change what's necessary in the backup (/etc/fstab ?) so that it will work when booted on SD
  9. similarly adjust kernels available on SD
  10. test the dual-booting from flash or SD

More details about each steps needed.

Backup of system in flash to a backup dir on SD

Assuming one has booted from a system on SD already, this would create a copy of the root partition in the freerunner's flash to a "/backup-dir" directory, on the SD.

# mkdir /mnt/memroot/
# mkdir /backup-dir
# mount -t jffs2 -o ro /dev/mtdblock6 /mnt/memroot/ # this for a freerunner
# cp -a /mnt/memroot/. /backup-dir/.

See Partitions for details of the partitions in flash (hence the /dev/mtdblock6).

Attention : there are problems copying certain files with cp -a : check that your backup and original are identical !

Transfer kernel to FAT partition

See inside /boot, where you should find a "/boot/uImage-2.6.24" image, ready to be put on the FAT partition to be used by u-boot.

You should verify it's a "u-boot/PPCBoot image" with the command "file"

Personal tools

This is an attempt at describing how one can "backup" or move an existing current system running in the FR flash NAND to the micro SD card, in order to boot from it. See associate thread here.

Typical scenario :

  • running 2007.2 from flash
  • want to install OM 2008.8 without loosing the "backup" 2007.7 in cas of need, to be booted from SD

Necessary steps (to be confirmed, don't try this unless you know what you're doing !) :

  1. Establish a running system on SD (see Booting from SD)
  2. reboot from that alternate system on SD
  3. from that system on SD, transfer content of flash to a backup dir on SD (provided SD is big enough to hold 2 systems)
  4. flash with new system
  5. reboot under newly flashed system
  6. remove old system from SD's root (the one which was booted in before to do the backup)
  7. move the backup from the backup dir of the SD to the root of the SD
  8. change what's necessary in the backup (/etc/fstab ?) so that it will work when booted on SD
  9. similarly adjust kernels available on SD
  10. test the dual-booting from flash or SD

More details about each steps needed.

Backup of system in flash to a backup dir on SD

Assuming one has booted from a system on SD already, this would create a copy of the root partition in the freerunner's flash to a "/backup-dir" directory, on the SD.

# mkdir /mnt/memroot/
# mkdir /backup-dir
# mount -t jffs2 -o ro /dev/mtdblock6 /mnt/memroot/ # this for a freerunner
# cp -a /mnt/memroot/. /backup-dir/.

See Partitions for details of the partitions in flash (hence the /dev/mtdblock6).

Attention : there are problems copying certain files with cp -a : check that your backup and original are identical !

Transfer kernel to FAT partition

See inside /boot, where you should find a "/boot/uImage-2.6.24" image, ready to be put on the FAT partition to be used by u-boot.

You should verify it's a "u-boot/PPCBoot image" with the command "file"