Difference between revisions of "Jetson/Cloning"

From eLinux.org
Jump to: navigation, search
(procedure for cloning & restoring backup images of the Jetson)
 
m (formatting of cloning page)
Line 1: Line 1:
 +
__FORCETOC__
 +
== Cloning the image ==
 +
 
To make a carbon copy of an existing Jetson install, first connect the Jetson's micro-B USB flash port to the Linux machine that you originally flashed L4T from.  Then enter the Jetson into recovery mode by holding RECOVERY and pressing RESET.
 
To make a carbon copy of an existing Jetson install, first connect the Jetson's micro-B USB flash port to the Linux machine that you originally flashed L4T from.  Then enter the Jetson into recovery mode by holding RECOVERY and pressing RESET.
 
== Cloning the image ==
 
  
 
cd into the Linux_for_Tegra/bootloader directory that you used when originally flashing the Jetson.  Inspect flash.cfg to obtain the partition id of system.img (in this case, 9)
 
cd into the Linux_for_Tegra/bootloader directory that you used when originally flashing the Jetson.  Inspect flash.cfg to obtain the partition id of system.img (in this case, 9)
  
[code][partition]
+
<pre>[partition]
 
name=APP
 
name=APP
 
id=9
 
id=9
Line 16: Line 17:
 
allocation_attribute=8
 
allocation_attribute=8
 
percent_reserved=0
 
percent_reserved=0
filename=system.img[/code]
+
filename=system.img</pre>
  
 
Next, remove the old system.img built from the initial flashing and download the new image from the Jetson.  If the id of your system.img partition is different than 9, substitute that in the nvflash command.
 
Next, remove the old system.img built from the initial flashing and download the new image from the Jetson.  If the id of your system.img partition is different than 9, substitute that in the nvflash command.
  
[code]sudo rm system.img
+
<pre>sudo rm system.img
 
sudo ./nvflash --read 9 system.img --bl fastboot.bin --go
 
sudo ./nvflash --read 9 system.img --bl fastboot.bin --go
[/code]
+
</pre>
  
 
(downloading the image can take a while)
 
(downloading the image can take a while)
Line 30: Line 31:
 
The image can be restored to a Jetson by flashing it with the -r 'skip building and reuse existing system.img' flag:
 
The image can be restored to a Jetson by flashing it with the -r 'skip building and reuse existing system.img' flag:
  
[code]cd ../
+
<pre>cd ../
 
sudo ./flash.sh -r -S 14580MiB jetson-tk1 mmcblk0p1
 
sudo ./flash.sh -r -S 14580MiB jetson-tk1 mmcblk0p1
[/code]
+
</pre>
  
 
Reboot the Jetson when it's done flashing and the system should be restored to the state at the time of cloning.
 
Reboot the Jetson when it's done flashing and the system should be restored to the state at the time of cloning.
Line 40: Line 41:
 
Keep the Linux_for_Tegra directory used during the cloning process to successfully restore the image.  Linux_for_Tegra/rootfs can be removed as it's no longer needed.  However the other L4T files should be transported along with the system.img to use during restoration.
 
Keep the Linux_for_Tegra directory used during the cloning process to successfully restore the image.  Linux_for_Tegra/rootfs can be removed as it's no longer needed.  However the other L4T files should be transported along with the system.img to use during restoration.
  
[code]sudo rm -r -f rootfs
+
<pre>sudo rm -r -f rootfs
 
cd ../
 
cd ../
 
tar -zcvf my_backup.tar.gz Linux_for_Tegra
 
tar -zcvf my_backup.tar.gz Linux_for_Tegra
[/code]
+
</pre>
  
 
tar.gz can significantly compress the size of system.img and will retain the access privileges and is now convenient to copy/FTP/ect.
 
tar.gz can significantly compress the size of system.img and will retain the access privileges and is now convenient to copy/FTP/ect.

Revision as of 12:57, 18 September 2014

Cloning the image

To make a carbon copy of an existing Jetson install, first connect the Jetson's micro-B USB flash port to the Linux machine that you originally flashed L4T from. Then enter the Jetson into recovery mode by holding RECOVERY and pressing RESET.

cd into the Linux_for_Tegra/bootloader directory that you used when originally flashing the Jetson. Inspect flash.cfg to obtain the partition id of system.img (in this case, 9)

[partition]
name=APP
id=9
type=data
allocation_policy=sequential
filesystem_type=basic
size=15288238080
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
filename=system.img

Next, remove the old system.img built from the initial flashing and download the new image from the Jetson. If the id of your system.img partition is different than 9, substitute that in the nvflash command.

sudo rm system.img
sudo ./nvflash --read 9 system.img --bl fastboot.bin --go

(downloading the image can take a while)

Restoring

The image can be restored to a Jetson by flashing it with the -r 'skip building and reuse existing system.img' flag:

cd ../
sudo ./flash.sh -r -S 14580MiB jetson-tk1 mmcblk0p1

Reboot the Jetson when it's done flashing and the system should be restored to the state at the time of cloning.

Packaging

Keep the Linux_for_Tegra directory used during the cloning process to successfully restore the image. Linux_for_Tegra/rootfs can be removed as it's no longer needed. However the other L4T files should be transported along with the system.img to use during restoration.

sudo rm -r -f rootfs
cd ../
tar -zcvf my_backup.tar.gz Linux_for_Tegra

tar.gz can significantly compress the size of system.img and will retain the access privileges and is now convenient to copy/FTP/ect.