How to backup a jetson nano image file

Can you post/pm a script or some sort of log of the exact steps you ran (especially within the chroot). This is a reason I suggested a script might be useful.

I will try to replicate and fix. My feeling is that this all revolves around the user creation. Even those commands alone would be useful to replicate.

When you say “cannot enter the desktop”, do you mean the password is rejected or does it hang?

When you log in from a tty, I am assuming the password works, but you say you don’t get bash. What happens when you run /bin/bash from the tty?

What is shown under “Shell” when you run the “finger” command for the user you created?

After First of all thank you for your reply, I am here to re-create the image file, there is no recurring problem. It may be that I used incorrect instructions after using “enter_chroot.sh”, which caused this situation.

I used sdkmanager to download all the nano files, but how to install these in the image file. For example, cuda, tensorrt, cudnn. I thought I used enter_chroot.sh, then dpkg -i …, and it didn’t feel right

Possibly. What commands did you run within the chroot? Your problems seems to be related to user creation, which is why I asked about that part. Do you have a script you created at step 1, or the command you ran to create your user? I’m asking because Nvidia’s first boot scripts reset the default user so if you create one before those scripts run, you must use certain parameters to avoid it (eg. make a system user).

Edit: updated post after testing:

If you are using JetPack 4.3, you can use apt-get to install those packages from within the chroot. All many of their package names start with “nvidia”.

You will have to edit rootfs/etc/apt/sources.list.d/nvidia-l4t-apt-source.list to match the following for Nano:

deb https://repo.download.nvidia.com/jetson/common r32 main
deb https://repo.download.nvidia.com/jetson/t210 r32 main

To see what packages are available (edit: for better solution, see this post), run “apt list nvidia*” within the chroot (after apt update) like this

root@hostname:/# apt list nvidia*
Listing... Done
nvidia-cg-doc/bionic 3.1.0013-3 all
nvidia-container-csv-cuda/stable 10.0.326-1 arm64
nvidia-container-csv-cudnn/stable 7.6.3.28-1+cuda10.0 arm64
nvidia-container-csv-tensorrt/stable 6.0.1.10-1+cuda10.0 arm64
nvidia-container-csv-visionworks/stable 1.6.0.500n arm64
nvidia-container-runtime/stable 3.1.0-1 arm64
nvidia-container-toolkit/stable 1.0.1-1 arm64
nvidia-cuda-doc/bionic 9.1.85-3ubuntu1 all
nvidia-docker2/stable 2.2.0-1 all
nvidia-jetpack/stable 4.3-b134 arm64
nvidia-l4t-3d-core/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-apt-source/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-bootloader/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-camera/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-ccp-t210ref/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-configs/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-core/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-cuda/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-firmware/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-graphics-demos/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-gstreamer/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-init/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-initrd/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-jetson-io/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-jetson-multimedia-api/stable 32.3.1-20191209225816 arm64
nvidia-l4t-kernel/stable,now 4.9.140-tegra-32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-kernel-dtbs/stable,now 4.9.140-tegra-32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-kernel-headers/stable,now 4.9.140-tegra-32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-multimedia/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-multimedia-utils/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-oem-config/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-tools/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-wayland/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-weston/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-x11/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-l4t-xusb-firmware/stable,now 32.3.1-20191209225816 arm64 [installed]
nvidia-prime/bionic-updates 0.8.8.2 all
nvidia-settings/bionic-updates 390.77-0ubuntu0.18.04.1 arm64

I believe nvidia-l4t-jetson-multimedia-api is the one you are looking for, but on my rootfs this was already installed. The OTA system is new. Somebody from nvidia should answer what packages provide those individual dependencies you need.

I did some tests myself, and it seems some packages are not prefixed by “nvidia…”.

Deepstream 4.0 can be installed within the chroot after setting up the sources like:

apt install deepstream-4.0

TensorRT seems to be “tensorrt” so:

apt install tensorrt

You can use “apt list” with wildcards as shown in the above post to search for more (as well as “apt search nvidia”). There is probably a more elegant way to list all the packages in a repo, but i’m unsure of it offhand (edit: there is, see post below). In any case these commands should allow you to pre-install these packages on the rootfs so they are already installed on your rootfs, avoiding having to use SDKM to flash the board or install those packages directly.

So I googled, and this is the way you can find a list of all the packages (from within the chroot):

root@hostname:/# grep ^Package /var/lib/apt/lists/repo.download.nvidia.com_jetson_t210_dists_r32_main_binary-arm64_Packages | awk '{print $2}' | sort -u
graphsurgeon-tf
jetson-gpio-common
libnvinfer6
libnvinfer-bin
libnvinfer-dev
libnvinfer-doc
libnvinfer-plugin6
libnvinfer-plugin-dev
libnvinfer-samples
libnvonnxparsers6
libnvonnxparsers-dev
libnvparsers6
libnvparsers-dev
nvidia-jetpack
nvidia-l4t-3d-core
nvidia-l4t-apt-source
nvidia-l4t-bootloader
nvidia-l4t-camera
nvidia-l4t-ccp-t210ref
nvidia-l4t-configs
nvidia-l4t-core
nvidia-l4t-cuda
nvidia-l4t-firmware
nvidia-l4t-graphics-demos
nvidia-l4t-gstreamer
nvidia-l4t-init
nvidia-l4t-initrd
nvidia-l4t-jetson-io
nvidia-l4t-jetson-multimedia-api
nvidia-l4t-kernel
nvidia-l4t-kernel-dtbs
nvidia-l4t-kernel-headers
nvidia-l4t-multimedia
nvidia-l4t-multimedia-utils
nvidia-l4t-oem-config
nvidia-l4t-tools
nvidia-l4t-wayland
nvidia-l4t-weston
nvidia-l4t-x11
nvidia-l4t-xusb-firmware
python3-jetson-gpio
python3-libnvinfer
python3-libnvinfer-dev
python-jetson-gpio
python-libnvinfer
python-libnvinfer-dev
tensorrt
uff-converter-tf
root@hostname:/# grep ^Package /var/lib/apt/lists/repo.download.nvidia.com_jetson_common_dists_r32_main_binary-arm64_Packages | awk '{print $2}' | sort -u
cuda-command-line-tools-10-0
cuda-compiler-10-0
cuda-core-10-0
cuda-cublas-10-0
cuda-cublas-dev-10-0
cuda-cudart-10-0
cuda-cudart-dev-10-0
cuda-cufft-10-0
cuda-cufft-dev-10-0
cuda-cuobjdump-10-0
cuda-cupti-10-0
cuda-curand-10-0
cuda-curand-dev-10-0
cuda-cusolver-10-0
cuda-cusolver-dev-10-0
cuda-cusparse-10-0
cuda-cusparse-dev-10-0
cuda-documentation-10-0
cuda-driver-dev-10-0
cuda-gdb-10-0
cuda-gdb-src-10-0
cuda-gpu-library-advisor-10-0
cuda-libraries-10-0
cuda-libraries-dev-10-0
cuda-license-10-0
cuda-memcheck-10-0
cuda-minimal-build-10-0
cuda-misc-headers-10-0
cuda-npp-10-0
cuda-npp-dev-10-0
cuda-nsight-compute-addon-l4t-10-0
cuda-nvcc-10-0
cuda-nvdisasm-10-0
cuda-nvgraph-10-0
cuda-nvgraph-dev-10-0
cuda-nvml-dev-10-0
cuda-nvprof-10-0
cuda-nvprune-10-0
cuda-nvrtc-10-0
cuda-nvrtc-dev-10-0
cuda-nvtx-10-0
cuda-samples-10-0
cuda-toolkit-10-0
cuda-tools-10-0
deepstream-4.0
libcublas10
libcublas-dev
libcudnn7
libcudnn7-dev
libcudnn7-doc
libnvidia-container0
libnvidia-container-tools
libopencv
libopencv-dev
libopencv-python
libopencv-samples
libvisionworks
libvisionworks-dev
libvisionworks-samples
libvisionworks-sfm
libvisionworks-sfm-dev
libvisionworks-tracking
libvisionworks-tracking-dev
nvidia-container-csv-cuda
nvidia-container-csv-cudnn
nvidia-container-csv-tensorrt
nvidia-container-csv-visionworks
nvidia-container-runtime
nvidia-container-toolkit
nvidia-docker2
opencv-licenses
vpi
vpi-dev
vpi-samples

You should be able to apt install pretty much anything on that list from within the chroot

So, I just booted the system after installing deepstream, tensor_rt, and a bunch of other stuff. First boot scripts executed as intended and I’m left with a system that requires no updates and already has all the stuff I want installed. Neat. If you run into any difficulties, don’t hesitate to ask.

hi mdegans,
i folllowwed your steps and stuck at installaing cuda, tensorrt, cudnn.

I also added in rootfs/etc/apt/sources.list.d/nvidia-l4t-apt-source.list to:
deb https://repo.download.nvidia.com/jetson/common r32 main
deb https://repo.download.nvidia.com/jetson/t210 r32 main

after that i ran apt update but its failed because my jetpack version is 4.2

Example note:(NVIDIA Jetson NANO/TX1 - Jetpack 4.2 [L4T 32.1.0]),(tensorflow-1.14)

So,what is the alternatives for jetpack 4.2 to install cuda-10.0,tensorrt-5.1,cudnn

apt update error:

Get:1 https://repo.download.nvidia.com/jetson/common r32 InRelease [2,541 B]
Get:2 https://repo.download.nvidia.com/jetson/t210 r32 InRelease [2,555 B]
Hit:3 http://ports.ubuntu.com/ubuntu-ports bionic InRelease   
Hit:4 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease
Hit:6 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease
Err:1 https://repo.download.nvidia.com/jetson/common r32 InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0D296FFB880FB004
Err:2 https://repo.download.nvidia.com/jetson/t210 r32 InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0D296FFB880FB004
Reading package lists... Done
W: GPG error: https://repo.download.nvidia.com/jetson/common r32 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0D296FFB880FB004
E: The repository 'https://repo.download.nvidia.com/jetson/common r32 InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: https://repo.download.nvidia.com/jetson/t210 r32 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0D296FFB880FB004
E: The repository 'https://repo.download.nvidia.com/jetson/t210 r32 InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Hi, thohtdelta,

Nvidia’s online repos probably only work with 4.3 and up. Nvidia’s key is not installed on 4.2 rootfs and even if it was, it would probably break things.

Hello,mdegans,
Thank you for your support and detailed answers. The previous problem did occur because the account was created after enter_chroot.sh and then the image was created.
Due to my network limitation (source.list you provided), I cannot use it as a download source. I consider other ways. One more thing. Going back to the original question, this is not my original intention to make images. He and I have different expectations. I don’t know which scripts were executed after the system was first turned on. I want to be able to skip scripts used to create accounts or preset accounts. After burning the image, you can use Jetson nano directly. What should i do, could you give me some advice.and most of the time, I can not use Google

Creating a user will probably work if you use a uid and gid other than 1000. I recommend choosing uid < 1000 for a daemon or app you nee to run (adduser --system) and if you need any interactive user to login start at 1100 or something (adduser --gid 1100 --uid 1100). The Nvidia first boot should only reset uid/gid 1000. More details:

http://manpages.ubuntu.com/manpages/xenial/man8/adduser.8.html

I am not sure what you mean by “network limitation”. It should work fine. If you’re not allowed to o connect the device to the internet for security reasons, you probably must use dpkg to install or a local apt mirror.

If you want to skip certain first boot things, most of Nvidia’s first boot scripts are in /etc/systemd and the unit files (.service) that execute them live in /etc/systemd/system

To my recollection, all start with nv. You may wish to review them and disable as appropriate to your use case.

Hi mdegans,
Thanks for your help but I haven’t done it yet. Can you make tutorial video for everyone !

Hi mdegans,
Thanks for your help but I haven’t done it yet. Can you make tutorial video for everyone !

Sure. I think I can manage that after I am done with the next version of the project I am working on. Anything specific you want me to cover? Just how to package your software and master a custom image with your software preinstalled?

1 Like

Thanks mdegans very much. I want backup my image file jetson nano to another SDcard. I am looking forward to your video tutorial. I’m not very good at English so I hope you help !

@fulloption1998

Please see this thread:

How to clone Jetson Nano SD Card? - #12 by mdegans

please elaborate step 1

i am not understanding how can do this thing please give me replay

hi,
I am struggling to create image now i get your reply but i can,t understand can you explain How to create this script you mentioned in instruction

please explain