Backup+and+restore+DevKit8000+file+system

toc =Introduction= Since the complete Linux file system for the DevKit8000 is on an SD card, it is very simple to create backups of the entire file system and restore previously created backups. Follow the below procedures:

Creating a backup of your DevKit8000 file system
For this, you will need an SD card (512MB minimum) and a way to access it from the Ubuntu host, either through a built-in SD card reader on your PC or through an external SD card reader. 1. Insert the SD card and wait for it to pop up in Ubuntu. If it doesn't, check that the SD card reader device is connected to the virtual machine in the menu "VM" > "Removable devices". 2. Open a terminal, then give the following command: code code An example result is code Major minor #blocks name 8 0 20971520 sda 8 1 20049088 sda1 8 2 1 sda2 8 5 915673 sda5 8 32 1931264 sdb 8 33 409626 sdb1 8 34 1518142 sdb2 code This will show all active partitions in the system, of which three partitions are your SD card, typically, , and (these names are used in the rest of this procedure, substitute with the ones resulting from the above command on your computer). 3. Unmount the two partitions sdb1 and sdb2 using the following commands, but *do not* remove the card physically: code code 4. Create the backup: 5. Blast the image to the SD card with the command. **NOTE**: Be very, very careful to use the correct output file in the below command. Using the wrong partition will most likely ruin your Ubuntu image - and your day! code code It is recommended to include the version and the size of the image in the image name, e.g. Testimage_v1_512MB.img 6. Optionally compresss the created image: code code
 * 1) cat /proc/partitions
 * 1) umount /dev/sdb1
 * 2) umount /dev/sdb2
 * 1) sudo dd if=/dev/sdb of=imagename.img if=/dev/sdb bs=1M
 * 1) tar -cvf imagename.tar imagename.img

Restoring a backed-up DevKit8000 file system
To restore the file system from a previously created backup, follow this procedure: 1. Insert the SD card and wait for it to pop up in Ubuntu. If it doesn't, check that the SD card reader device is connected to the virtual machine in the menu "VM" > "Removable devices". 2. Open a terminal, then give the following command: code code An example result is code Major minor  #blocks name 8    0   20971520 sda 8    1   20049088 sda1 8    2      1 sda2 8    5     915673 sda5 8   32    1931264 sdb 8   33     409626 sdb1 8   34    1518142 sdb2 code This will show all active partitions in the system, of which three partitions are your SD card, typically, , and (these names are used in the rest of this procedure, substitute with the ones resulting from the above command on your computer). 3. Unmount the two partitions sdb1 and sdb2 using the following commands, but *do not* remove the card physically: code code 4. Blast the image to the SD card with the command. **NOTE**: Be very, very careful to use the correct output file in the below command. Using the wrong partition will most likely ruin your Ubuntu image - and your day! code code
 * 1) cat /proc/partitions
 * 1) umount /dev/sdb1
 * 2) umount /dev/sdb2
 * 1) sudo dd if=imagename.img of=/dev/sdb bs=1M

Using the SD card on the DevKit8000
1. Insert the recently blasted SD card into the DevKit8000 2. Hold the push button down, then apply power to the DevKit. A lot of reading and copying will now take place. 3. When copying is complete (you are presented with a prompt), reset the DevKit8000 and let it boot From now on, the SD card needs to be in the DevKit8000 for the board to boot.

Note! How to use dd to create a file of a given size: code dd if=/dev/zero of=output.dat bs=1M  count=10 code Creates a 10MB binary file filled with zeros.

=Doing it Windows Style!=

Download DD for windows here: []

Unzip it to ex c:\temp\dd

Get the latest version of the SD cardgolden image: home10.iha.dk\staff2stud\EIT-elektro og IKT\3. Semester\I3ISU\DevKit8000 Golden Image

Unpack it (Use 7-zip or similar). The file must be named goldenSDImage_v4_512.img. If the extension is .tar.bz2, then you will have to extract it once more. (An archive in an archive!!)

Put the SD card into the card reader, notice the drive letter asssigned. From the command prompt enter the following: cd temp/dd

dd --list This should result in something like:

\\.\Volume{0b73034b-a708-11df-abb3-806e6f6e6963}\ link to \\?\Device\HarddiskVolume1 fixed media Mounted on \\.\c:

\\.\Volume{b8ac596d-a6e5-11df-b77f-005056c00008}\ link to \\?\Device\HarddiskVolume7 removeable media Mounted on \\.\i:

\\.\Volume{b8ac5967-a6e5-11df-b77f-005056c00008}\ link to \\?\Device\HarddiskVolume8 removeable media Mounted on \\.\e:

This means the name of the SD card is \\?\Device\HarddiskVolume8

The \\?\ indicates all partitions on that volume

Now write the image: C:\temp\dd-0.6beta3>dd if=goldenSD_v3_512MB.img of=\\?\Device\HarddiskVolume8 bs=1M --progress

The card will now be programmed!